Very fun challenge today.
Your task is to… make the code compile.
Task Description:
- State needs to be an interface
- You can add member functions or extension functions to State
- There are no test cases, after succesfull compilation you’ll se the code.
We want to be able to use destructive declaration on state: State
fun useDestructiveDeclaration(state: State) {
val (a: String, b: Int) = state
}
- Fill in the code.
- You can copy the code into IntelliJ/Android Studio, but it shouldn’t be necessary.
- Click “run” – the green triangle. The code will compile and several tests will be run.
- In the logs, you will see “try again” if the solution is incorrect, or “success” and a special code.
- Provide this code in the form below along with your email and click “send”.