June 2018
Intermediate to advanced
316 pages
6h 34m
English
In the preceding example, I used a special function, TODO(), from the Kotlin standard library. This function is overloaded and has two implementations:
@kotlin.internal.InlineOnlypublic inline fun TODO(): Nothing = throw NotImplementedError()@kotlin.internal.InlineOnlypublic inline fun TODO(reason: String): Nothing = throw NotImplementedError("An operation is not implemented: $reason")
It's very useful when you're modeling a class and don't want to implement certain class members right away. You can also use it for methods, as shown in the following code:
fun click() { TODO()}
And you can use it for constructors as well:
constructor() { TODO()}
Let's look at how the Button class decompiled to Java:
public final class ...Read now
Unlock full access