Files
kotlin-fork/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.kt
T
Alexander Udalov 43c37398af Labeled this & super to nested class' outer is an error
#KT-1174 In Progress
2013-01-16 23:11:42 +04:00

26 lines
883 B
Kotlin

class Outer {
fun function() = 42
val property = ""
class Nested {
fun f() = <!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>function()<!>
fun g() = <!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>property<!>
fun h() = this<!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>@Outer<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>function<!>()
fun i() = this<!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>@Outer<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>property<!>
}
inner class Inner {
fun innerFun() = function()
val innerProp = property
fun innerThisFun() = this@Outer.function()
val innerThisProp = this@Outer.property
inner class InnerInner {
fun f() = innerFun()
fun g() = innerProp
fun h() = this@Inner.innerFun()
fun i() = this@Inner.innerProp
}
}
}