What does "them" mean in Kotlin?

I didn't find an explanation in the link, but when I type impl

in IntelliJ IDEA I get the error:

f64cbfae-42b4-11e7-9d2e-bdc0874354be.png

It seems like it was seen as a reserved word, but what is it for? I tried to add a lot of things after impl

, but I get the error every time.

Update: it has been renamed to expect

after Kotlin 1.2.

+3


source to share


1 answer


This is for future multiplatform project support and this is a keyword pair header

that @hotkey explains in his comment here . It appeared in one of the presentations by Andrey Breslav, where you can find it here , this topic starts at 14:25.

To summarize briefly, the main idea it presents is that you can have a common module shared between your platforms that has some functionality that is declared but not implemented and tagged with a keyword header

. Then, for different platforms (JVM, JS, etc.) you can have separate modules that implement those platform specific functionality - these actual implementations include the keyword impl

.

His slide about it



He says the whole system is just an internal prototype right now, so this presentation is probably the public information we have about it. I am also interested in more details about this mechanism :)


Update: As of Kotlin 1.2 Beta, these keywords are now replaced with expect

and actual

.

+9


source







All Articles