0ff9982b31
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
67 lines
1.1 KiB
Kotlin
Vendored
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<!>()
|
|
}
|
|
}
|
|
}
|