FIR: implement qualifier resolver
This commit is contained in:
committed by
Mikhail Glukhikh
parent
d3cc0e6ce9
commit
cef108a5ae
+3
-3
@@ -23,7 +23,7 @@ FILE: enum.kt
|
||||
|
||||
public final enum entry FIRST : R|SomeEnum| {
|
||||
public constructor(): R|SomeEnum.FIRST| {
|
||||
super<R|SomeEnum|>(R|/O1|)
|
||||
super<R|SomeEnum|>(Q|O1|)
|
||||
}
|
||||
|
||||
public final override fun check(y: R|Some|): R|kotlin/Boolean| {
|
||||
@@ -34,11 +34,11 @@ FILE: enum.kt
|
||||
|
||||
public final enum entry SECOND : R|SomeEnum| {
|
||||
public constructor(): R|SomeEnum.SECOND| {
|
||||
super<R|SomeEnum|>(R|/O2|)
|
||||
super<R|SomeEnum|>(Q|O2|)
|
||||
}
|
||||
|
||||
public final override fun check(y: R|Some|): R|kotlin/Boolean| {
|
||||
^check ==(R|<local>/y|, R|/O2|)
|
||||
^check ==(R|<local>/y|, Q|O2|)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ FILE: companion.kt
|
||||
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
R|/A|.R|/A.Companion.foo|()
|
||||
R|/B|.<Inapplicable(WRONG_RECEIVER): [/A.bar]>#()
|
||||
R|/B|.R|/B.Companion.baz|()
|
||||
lval x: R|kotlin/String| = R|/A|.R|/A.Companion.D|
|
||||
lval y: R|kotlin/String| = R|/B|.R|/B.Companion.C|
|
||||
lval z: <ERROR TYPE REF: Unresolved name: D> = R|/B|.<Unresolved name: D>#
|
||||
Q|A|.R|/A.Companion.foo|()
|
||||
Q|B|.R|/A.bar|()
|
||||
Q|B|.R|/B.Companion.baz|()
|
||||
lval x: R|kotlin/String| = Q|A|.R|/A.Companion.D|
|
||||
lval y: R|kotlin/String| = Q|B|.R|/B.Companion.C|
|
||||
lval z: <ERROR TYPE REF: Unresolved name: D> = Q|B|.<Unresolved name: D>#
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ FILE: objects.kt
|
||||
|
||||
}
|
||||
public final fun use(): R|A| {
|
||||
^use R|/A|
|
||||
^use Q|A|
|
||||
}
|
||||
public final fun bar(): R|A| {
|
||||
^bar R|/A|.R|/A.foo|()
|
||||
^bar Q|A|.R|/A.foo|()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package a.b
|
||||
|
||||
class C {
|
||||
object D {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
enum class E {
|
||||
entry
|
||||
}
|
||||
|
||||
fun foo() {}
|
||||
|
||||
val f = 10
|
||||
|
||||
fun main() {
|
||||
a.b.foo()
|
||||
a.b.C.foo()
|
||||
a.b.C.D.foo()
|
||||
val x = a.b.f
|
||||
C.foo()
|
||||
C().foo()
|
||||
val e = a.b.E.entry
|
||||
val e1 = E.entry
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
FILE: qualifiedExpressions.kt
|
||||
public final class C : R|kotlin/Any| {
|
||||
public constructor(): R|a/b/C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final object D : R|kotlin/Any| {
|
||||
private constructor(): R|a/b/C.D| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
private constructor(): R|a/b/C.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final enum class E : R|kotlin/Enum| {
|
||||
private constructor(): R|a/b/E| {
|
||||
super<R|kotlin/Enum|>()
|
||||
}
|
||||
|
||||
public final enum entry entry : R|kotlin/Any| {
|
||||
public constructor(): R|a/b/E.entry| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
public final val f: R|kotlin/Int| = Int(10)
|
||||
public get(): R|kotlin/Int|
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
Q|a/b|.R|a/b/foo|()
|
||||
Q|a/b/C|.R|a/b/C.Companion.foo|()
|
||||
Q|a/b/C.D|.R|a/b/C.D.foo|()
|
||||
lval x: R|kotlin/Int| = Q|a/b|.R|a/b/f|
|
||||
Q|a/b/C|.R|a/b/C.Companion.foo|()
|
||||
R|a/b/C.C|().R|a/b/C.foo|()
|
||||
lval e: R|a/b/E| = Q|a/b/E.entry|
|
||||
lval e1: R|a/b/E| = Q|a/b/E.entry|
|
||||
}
|
||||
+2
-2
@@ -41,8 +41,8 @@ FILE: inner.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval o: R|Owner| = R|/Owner.Owner|()
|
||||
R|<local>/o|.R|/Owner.foo|()
|
||||
lval err: R|Owner.Inner| = R|/Owner|.R|/Owner.Inner.Inner|()
|
||||
R|<local>/err|.R|/Owner.Inner.baz|()
|
||||
lval err: <ERROR TYPE REF: Unresolved name: Inner> = Q|Owner|.<Unresolved name: Inner>#()
|
||||
R|<local>/err|.<Unresolved name: baz>#()
|
||||
lval i: R|Owner.Inner| = R|<local>/o|.R|/Owner.Inner.Inner|()
|
||||
R|<local>/i|.R|/Owner.Inner.gau|()
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,6 +40,6 @@ FILE: simple.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval o: R|Owner| = R|/Owner.Owner|()
|
||||
R|<local>/o|.R|/Owner.foo|()
|
||||
lval n: R|Owner.Nested| = R|/Owner|.R|/Owner.Nested.Nested|()
|
||||
R|<local>/n|.R|/Owner.Nested.baz|()
|
||||
lval n: <ERROR TYPE REF: Unresolved name: Nested> = Q|Owner|.<Unresolved name: Nested>#()
|
||||
R|<local>/n|.<Unresolved name: baz>#()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FILE: companionLoad.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
lval y: R|kotlin/Int| = R|kotlin/Int|.R|kotlin/Int.Companion.MAX_VALUE|
|
||||
lval y: R|kotlin/Int| = Q|kotlin/Int|.R|kotlin/Int.Companion.MAX_VALUE|
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FILE: reflectionClass.kt
|
||||
public final val javaClass: R|java/lang/Class<kotlin/String>| = <getClass>(R|kotlin/String|).R|kotlin/jvm/java|
|
||||
public final val javaClass: R|java/lang/Class<kotlin/String>| = <getClass>(Q|kotlin/String|).R|kotlin/jvm/java|
|
||||
public get(): R|java/lang/Class<kotlin/String>|
|
||||
public final val kotlinClass: R|kotlin/reflect/KClass<kotlin/String>| = <getClass>(R|kotlin/String|)
|
||||
public final val kotlinClass: R|kotlin/reflect/KClass<kotlin/String>| = <getClass>(Q|kotlin/String|)
|
||||
public get(): R|kotlin/reflect/KClass<kotlin/String>|
|
||||
|
||||
Reference in New Issue
Block a user