Files
kotlin-fork/compiler/testData/codegen/boxWithStdlib/regressions/referenceToSelfInLocal.kt
T
2014-01-14 19:13:16 +04:00

19 lines
431 B
Kotlin

// KT-4351 Cannot resolve reference to self in init of class local to function
fun box(): String {
var accessedFromConstructor: Class<*>? = null
class MyClass() {
{
accessedFromConstructor = javaClass<MyClass>()
}
}
MyClass()
if (accessedFromConstructor!!.getName().endsWith("MyClass")) {
return "OK"
} else {
return accessedFromConstructor.toString()
}
}