FIR: Implement FE 1.0 semantics for super unqualified calls

See original logic at org.jetbrains.kotlin.types.expressions.unqualifiedSuper.UnqualifiedSuperKt#resolveUnqualifiedSuperFromExpressionContext

^KT-39070 Fixed
^KT-39599 Related
This commit is contained in:
Denis Zharkov
2020-07-20 12:24:51 +03:00
parent dfc75f3447
commit cd896ae6c8
26 changed files with 285 additions and 82 deletions
@@ -0,0 +1,21 @@
interface A
open class B {
override fun equals(other: Any?): Boolean {
return super.equals(other)
}
override fun hashCode(): Int {
return super.hashCode()
}
}
class C : A, B() {
override fun equals(other: Any?): Boolean {
return super.equals(other)
}
override fun hashCode(): Int {
return super.hashCode()
}
}
@@ -0,0 +1,31 @@
FILE: superAny.kt
public abstract interface A : R|kotlin/Any| {
}
public open class B : R|kotlin/Any| {
public constructor(): R|B| {
super<R|kotlin/Any|>()
}
public open override fun equals(other: R|kotlin/Any?|): R|kotlin/Boolean| {
^equals this@R|/B|.super<R|kotlin/Any|>.R|kotlin/Any.equals|(R|<local>/other|)
}
public open override fun hashCode(): R|kotlin/Int| {
^hashCode this@R|/B|.super<R|kotlin/Any|>.R|kotlin/Any.hashCode|()
}
}
public final class C : R|A|, R|B| {
public constructor(): R|C| {
super<R|B|>()
}
public final override fun equals(other: R|kotlin/Any?|): R|kotlin/Boolean| {
^equals this@R|/C|.super<R|B|>.R|/B.equals|(R|<local>/other|)
}
public final override fun hashCode(): R|kotlin/Int| {
^hashCode this@R|/C|.super<R|B|>.R|/B.hashCode|()
}
}