Jonathan Ellis
07/26/2022, 4:14 PMimport kotlin.test.Test
class Undefined {
init {
println({ -> foo }.invoke())
}
val foo = 0
}
class Foo {
@Test
fun testUndefined() {
Undefined()
}
}
ephemient
07/26/2022, 5:10 PMval foo = 100
still results in 0
, so it's the fact that it's inferred as val foo: Int
that causes the result to be 0 on JVMJonathan Ellis
07/26/2022, 5:14 PMephemient
07/26/2022, 5:15 PMval foo: Any = 0
then you'd see null
on JVM