Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/kt900.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

69 lines
1.1 KiB
Kotlin
Vendored

//FILE:a.kt
//KT-900 Inaccessible class should be unresolved
package a
fun foo() {
val b : <!OTHER_ERROR!>B<!> = <!UNRESOLVED_REFERENCE!>B<!>() //only B() is unresolved, but in ": B" and "B.foo()" B should also be unresolved
<!UNRESOLVED_REFERENCE!>B<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
<!UNRESOLVED_REFERENCE!>P<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
<!UNRESOLVED_REFERENCE!>M<!>.<!UNRESOLVED_REFERENCE!>bar<!>()
}
class A() {
companion object {
class B() {
companion object {
fun foo() {}
}
}
object P {
fun foo() {}
}
}
}
object N {
object M {
fun bar() {}
}
}
//FILE:b.kt
package b
import b.N.M
import b.A.Companion.P
import b.A.Companion.B
fun foo() {
val b : B = B()
B.foo()
P.foo()
M.bar()
}
class A() {
companion object {
class B() {
companion object {
fun foo() {}
}
}
object P {
fun foo() {}
}
}
}
object N {
object M {
fun bar() {}
}
}