Files
kotlin-fork/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.kt
T
Alexander Udalov 239502368a Update test data for tower resolution algorithm
- locals win
- unary calls to plus/minus are not supported in favor of unaryPlus/unaryMinus
- unqualified nested classes are temporarily reported as unresolved
- function without receiver win against extension function
- explicit import win against star import
2015-12-11 17:01:02 +03:00

45 lines
883 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VARIABLE
open class A {
class NC {}
inner class IC {}
interface NI {}
}
interface I {
class NC {}
interface NI {}
}
class B : A() {
}
class C : I {
}
class D : A(), I {
}
fun test() {
val ac: A.NC = A.NC()
val aic: A.IC = A().IC()
val ai: A.NI? = null
val ic: I.NC = I.NC()
val ii: I.NI? = null
val bc: B.<!UNRESOLVED_REFERENCE!>NC<!> = B.<!UNRESOLVED_REFERENCE!>NC<!>()
val bic: B.<!UNRESOLVED_REFERENCE!>IC<!> = B().IC()
val bi: B.<!UNRESOLVED_REFERENCE!>NI<!>? = null
val cc: C.<!UNRESOLVED_REFERENCE!>NC<!> = C.<!UNRESOLVED_REFERENCE!>NC<!>()
val ci: C.<!UNRESOLVED_REFERENCE!>NI<!>? = null
val dc: D.<!UNRESOLVED_REFERENCE!>NC<!> = D.<!UNRESOLVED_REFERENCE!>NC<!>()
val dic: D.<!UNRESOLVED_REFERENCE!>IC<!> = D().IC()
val di: D.<!UNRESOLVED_REFERENCE!>NI<!>? = null
}