K2: add test for KT-56520, case (4), callable references (unbound)

Again, both frontends here ignored classifiers from
explicit star imported scope (some.HashMap, java.util.HashMap)
because of their ambiguity. In case of K2, it works so due to logic
in BodyResolveComponents.resolveRootPartOfQualifier.
This function is called to resolve qualifier without receiver.
See also cases (3) and (7).
This commit is contained in:
Mikhail Glukhikh
2023-10-30 11:41:15 +01:00
committed by Space Team
parent f0058ee0d8
commit c2ac9daa7f
7 changed files with 54 additions and 0 deletions
@@ -0,0 +1,4 @@
FILE: test.kt
public final fun test(): R|kotlin/reflect/KProperty1<kotlin/collections/HashMap<kotlin/String, kotlin/String>, kotlin/Int>| {
^test Q|kotlin/collections/HashMap|::R|SubstitutionOverride<java/util/HashMap.size: R|kotlin/Int|>|
}
@@ -0,0 +1,20 @@
// FIR_IDENTICAL
// ISSUE: KT-56520 (case 4, unbound)
// FIR_DUMP
// FULL_JDK
// FILE: some/HashMap.java
package some;
public class HashMap<K, V> extends java.util.HashMap<K, V> {}
// FILE: test.kt
import java.util.*
import some.*
fun test() =
// Ok in both K1 & K2.
// K1 & K2 resolve this to kotlin.collections.HashMap.
HashMap<String, String>::size