FIR: Fix ambiguity between current Companion and one from supertypes

Companion as qualifier should be found at static scope not a member one
This commit is contained in:
Denis Zharkov
2020-11-06 17:41:50 +03:00
parent 96352b9c8c
commit a5545b96cb
21 changed files with 114 additions and 216 deletions
@@ -0,0 +1,10 @@
enum class A {
X, Y;
companion object {
fun foo(): Int {
return 1
}
}
fun foo(): Int = Companion.foo()
}
@@ -0,0 +1,30 @@
FILE: companionAccessInEnum.kt
public final enum class A : R|kotlin/Enum<A>| {
private constructor(): R|A| {
super<R|kotlin/Enum<A>|>()
}
public final static enum entry X: R|A|
public final static enum entry Y: R|A|
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|A.Companion| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Int| {
^foo Int(1)
}
}
public final fun foo(): R|kotlin/Int| {
^foo Q|A.Companion|.R|/A.Companion.foo|()
}
public final static fun values(): R|kotlin/Array<A>| {
}
public final static fun valueOf(value: R|kotlin/String|): R|A| {
}
}