KT-4351 Cannot resolve reference to self in init of class local to function

#KT-4351 fixed
This commit is contained in:
Evgeny Gerashchenko
2014-01-11 01:41:45 +04:00
parent 958f7c862d
commit e994b718cb
7 changed files with 66 additions and 12 deletions
@@ -0,0 +1,18 @@
// 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()
}
}