Is this a bug of Kotlin REPL?

Viewed 434

I can define a value in Kotlin REPL like this(recursively) without getting an error:

val s: String = s

And now I get an 's' with the type of NotNull but the value of null.
And I can do something with this NotNull value with a NPE:

>>> val s: String = s

>>> s.length
java.lang.NullPointerException

You can try it on your own Kotlin REPL, it works every time.

I am using Kotlin version 1.1.2-3.

2 Answers
Related