e6b5cb5216
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
70 lines
1.5 KiB
Kotlin
Vendored
70 lines
1.5 KiB
Kotlin
Vendored
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
|
|
|
// ===== Case 1: LHS is a class
|
|
//
|
|
object A {
|
|
open class Base {
|
|
companion object {
|
|
class FromBaseCompanion {
|
|
fun foo() = 42
|
|
}
|
|
}
|
|
}
|
|
|
|
class Derived : Base() {
|
|
val a = <!DEPRECATED_ACCESS_BY_SHORT_NAME!>FromBaseCompanion<!>::foo
|
|
}
|
|
}
|
|
|
|
// ===== Case 2: LHS is a class with companion object, function comes from class
|
|
|
|
object B {
|
|
open class Base {
|
|
companion object {
|
|
class FromBaseCompanion {
|
|
fun foo() = 42
|
|
|
|
companion object {}
|
|
}
|
|
}
|
|
}
|
|
|
|
class Derived : Base() {
|
|
val a = <!DEPRECATED_ACCESS_BY_SHORT_NAME!>FromBaseCompanion<!>::foo
|
|
}
|
|
}
|
|
|
|
// ==== Case 3: LHS is a class with companion object, function comes from companion
|
|
|
|
object C {
|
|
open class Base {
|
|
companion object {
|
|
class FromBaseCompanion {
|
|
companion object {
|
|
fun foo() = 42
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
class Derived : Base() {
|
|
val a = <!DEPRECATED_ACCESS_BY_SHORT_NAME!>FromBaseCompanion<!>::<!UNRESOLVED_REFERENCE!>foo<!>
|
|
}
|
|
}
|
|
|
|
// ==== Case 4: LHS is an object
|
|
|
|
object D {
|
|
open class Base {
|
|
companion object {
|
|
object FromBaseCompanion {
|
|
fun foo() = 42
|
|
}
|
|
}
|
|
}
|
|
|
|
class Derived : Base() {
|
|
val a = <!DEPRECATED_ACCESS_BY_SHORT_NAME!>FromBaseCompanion<!>::foo
|
|
}
|
|
}
|