[FIR] Support diagnostic ABSTRACT_SUPER_CALL

This commit is contained in:
Nick
2020-04-11 14:29:50 +03:00
committed by Mikhail Glukhikh
parent 8960829c01
commit c4b7ac994b
12 changed files with 215 additions and 13 deletions
@@ -0,0 +1,41 @@
open class C {
open val x: Int = 10
fun h() {}
}
abstract class A : C() {
override val x: Int = 20
abstract val y: Int
abstract fun f()
fun t() {
super.h()
super.x
}
}
class B : A() {
override fun f() {
}
fun g() {
super.<!ABSTRACT_SUPER_CALL!>f<!>()
super.t()
super.x
super.<!ABSTRACT_SUPER_CALL!>y<!>
}
}
abstract class J : A() {
fun r() {
super.<!ABSTRACT_SUPER_CALL!>f<!>()
super.t()
super.x
super.<!ABSTRACT_SUPER_CALL!>y<!>
}
}
@@ -0,0 +1,61 @@
FILE: abstractSuperCall.kt
public open class C : R|kotlin/Any| {
public constructor(): R|C| {
super<R|kotlin/Any|>()
}
public open val x: R|kotlin/Int| = Int(10)
public get(): R|kotlin/Int|
public final fun h(): R|kotlin/Unit| {
}
}
public abstract class A : R|C| {
public constructor(): R|A| {
super<R|C|>()
}
public open override val x: R|kotlin/Int| = Int(20)
public get(): R|kotlin/Int|
public abstract val y: R|kotlin/Int|
public get(): R|kotlin/Int|
public abstract fun f(): R|kotlin/Unit|
public final fun t(): R|kotlin/Unit| {
super<R|C|>.R|/C.h|()
super<R|C|>.R|/C.x|
}
}
public final class B : R|A| {
public constructor(): R|B| {
super<R|A|>()
}
public final override fun f(): R|kotlin/Unit| {
}
public final fun g(): R|kotlin/Unit| {
super<R|A|>.R|/A.f|()
super<R|A|>.R|/A.t|()
super<R|A|>.R|/A.x|
super<R|A|>.R|/A.y|
}
}
public abstract class J : R|A| {
public constructor(): R|J| {
super<R|A|>()
}
public final fun r(): R|kotlin/Unit| {
super<R|A|>.R|/A.f|()
super<R|A|>.R|/A.t|()
super<R|A|>.R|/A.x|
super<R|A|>.R|/A.y|
}
}