Files
kotlin-fork/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.fir.kt
T
Mikhail Glukhikh 0804c6a0f3 [FIR] Introduce TYPE_ARGUMENTS_NOT_ALLOWED & some other type errors
This commit introduces several different things, in particular:
- check type arguments in expressions
- new TypeArgumentList node to deal with diagnostic source
- ConeDiagnostic was moved to fir:cones
- ConeIntermediateDiagnostic to use in inference (?) without reporting
- detailed diagnostics on error type
2020-08-02 18:19:44 +03:00

45 lines
811 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: <!OTHER_ERROR!>B.NC<!> = B.<!UNRESOLVED_REFERENCE!>NC<!>()
val bic: <!OTHER_ERROR!>B.IC<!> = B().IC()
val bi: <!OTHER_ERROR!>B.NI?<!> = null
val cc: <!OTHER_ERROR!>C.NC<!> = C.<!UNRESOLVED_REFERENCE!>NC<!>()
val ci: <!OTHER_ERROR!>C.NI?<!> = null
val dc: <!OTHER_ERROR!>D.NC<!> = D.<!UNRESOLVED_REFERENCE!>NC<!>()
val dic: <!OTHER_ERROR!>D.IC<!> = D().IC()
val di: <!OTHER_ERROR!>D.NI?<!> = null
}