Files
kotlin/compiler/testData/diagnostics/tests/qualifiedExpression/visibleClassVsQualifiedClass.kt
Dmitry Petrov e1cb13bd90 Qualifier no longer defers "(nested) class vs package" resolution.
Consider FQN 'a.b.c'.
If 'a' is a classifier in the current scope,
    resolve rest in the corresponding class scope.
Otherwise (if 'a' is a package),
    find the maximum possible prefix 'a.b' resolving to a package,
    resolve rest in the corresponding package scope.
2015-11-02 10:22:50 +03:00

58 lines
1005 B
Kotlin
Vendored

// MODULE: m1
// FILE: a.kt
package a
class b {
fun a_b() {}
}
// MODULE: m2
// FILE: b.kt
package some
class a {
class b {
fun some_ab() {}
}
}
// MODULE: m3(m1, m2)
// FILE: c1.kt
package other
class a {}
fun test(a_: a.<!UNRESOLVED_REFERENCE!>b<!>) {
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_b<!>()
val a_2 = a.<!UNRESOLVED_REFERENCE!>b<!>()
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_2<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_b<!>()
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_2<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>some_ab<!>()
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_2<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a_<!>()
}
// FILE: c2.kt
package other2
class a {
class b {
fun other2_ab() {}
}
}
fun test(_ab: a.b) {
_ab.other2_ab()
val _ab2 = a.b()
_ab2.other2_ab()
}
// FILE: c3.kt
package some
fun test(_ab: a.b) {
_ab.some_ab()
val _ab2 = a.b()
_ab2.some_ab()
}