Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.fir.kt
T
Brian Norman 0ff9982b31 [FIR] Additional errors to distinguish resolution to classifier cases
When a call is resolved to a classifier, only a single error message was
being used for multiple cases. This lead to confusion as the default
message may not be applicable to a given error case. Added additional
errors and messages to distinguish between these error cases.

#KT-57251 Fixed
2023-06-16 16:26:50 +00:00

67 lines
1.1 KiB
Kotlin
Vendored

// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
open class A {
inner class B {
fun foo() {}
}
inner class D
companion object {
class B {
fun bar() {}
}
class C
}
init {
B().foo()
B().<!UNRESOLVED_REFERENCE!>bar<!>()
D()
C()
}
}
class E: A() {
init {
B().foo()
B().<!UNRESOLVED_REFERENCE!>bar<!>()
D()
<!UNRESOLVED_REFERENCE!>C<!>()
}
object Z {
init {
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B<!>().<!UNRESOLVED_REFERENCE!>foo<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B<!>().<!UNRESOLVED_REFERENCE!>bar<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>D<!>()
<!UNRESOLVED_REFERENCE!>C<!>()
}
}
}
class F: A() {
class B {
fun fas() {}
}
inner class D {
fun f() {}
}
init {
B().fas()
D().f()
}
companion object {
init {
B().fas()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>D<!>().<!UNRESOLVED_REFERENCE!>f<!>()
}
}
}