[FIR TEST] Add extra test for inner classes inside hierarchy

This commit is contained in:
Mikhail Glukhikh
2020-05-08 18:31:48 +03:00
parent f48ff2679e
commit 535b4434a8
4 changed files with 123 additions and 0 deletions
@@ -0,0 +1,25 @@
open class Base {
open inner class Inner
}
class Derived : Base() {
inner class InnerDerived : Inner() {
inner class VeryInner : <!UNRESOLVED_REFERENCE!>Inner<!>() {
inner class VeryVeryInner : <!UNRESOLVED_REFERENCE!>Inner<!>()
}
}
}
open class A(val s: String) {
open inner class B(s: String): A(s)
open inner class C(s: String, additional: Double): B(s)
open inner class D(other: Int, another: Long, s: String) : C(s, another.toDouble())
open inner class E : D(0, 42L, "OK")
inner class F : E()
}
fun box(): String = A("Fail").F().s
@@ -0,0 +1,88 @@
FILE: innerClassHierarchy.kt
public open class Base : R|kotlin/Any| {
public constructor(): R|Base| {
super<R|kotlin/Any|>()
}
public open inner class Inner : R|kotlin/Any| {
public constructor(): R|Base.Inner| {
super<R|kotlin/Any|>()
}
}
}
public final class Derived : R|Base| {
public constructor(): R|Derived| {
super<R|Base|>()
}
public final inner class InnerDerived : R|Base.Inner| {
public constructor(): R|Derived.InnerDerived| {
this@R|/Derived|.super<R|Base.Inner|>()
}
public final inner class VeryInner : R|Base.Inner| {
public constructor(): R|Derived.InnerDerived.VeryInner| {
super<R|Base.Inner|>()
}
public final inner class VeryVeryInner : R|Base.Inner| {
public constructor(): R|Derived.InnerDerived.VeryInner.VeryVeryInner| {
super<R|Base.Inner|>()
}
}
}
}
}
public open class A : R|kotlin/Any| {
public constructor(s: R|kotlin/String|): R|A| {
super<R|kotlin/Any|>()
}
public final val s: R|kotlin/String| = R|<local>/s|
public get(): R|kotlin/String|
public open inner class B : R|A| {
public constructor(s: R|kotlin/String|): R|A.B| {
super<R|A|>(R|<local>/s|)
}
}
public open inner class C : R|A.B| {
public constructor(s: R|kotlin/String|, additional: R|kotlin/Double|): R|A.C| {
this@R|/A|.super<R|A.B|>(R|<local>/s|)
}
}
public open inner class D : R|A.C| {
public constructor(other: R|kotlin/Int|, another: R|kotlin/Long|, s: R|kotlin/String|): R|A.D| {
this@R|/A|.super<R|A.C|>(R|<local>/s|, R|<local>/another|.R|kotlin/Long.toDouble|())
}
}
public open inner class E : R|A.D| {
public constructor(): R|A.E| {
this@R|/A|.super<R|A.D|>(Int(0), Long(42), String(OK))
}
}
public final inner class F : R|A.E| {
public constructor(): R|A.F| {
this@R|/A|.super<R|A.E|>()
}
}
}
public final fun box(): R|kotlin/String| {
^box R|/A.A|(String(Fail)).R|/A.F.F|().R|/A.s|
}
@@ -1644,6 +1644,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/flexibleTypeVarAgainstNull.kt");
}
@TestMetadata("innerClassHierarchy.kt")
public void testInnerClassHierarchy() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/innerClassHierarchy.kt");
}
@TestMetadata("javaAccessorConversion.kt")
public void testJavaAccessorConversion() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaAccessorConversion.kt");
@@ -1644,6 +1644,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/problems/flexibleTypeVarAgainstNull.kt");
}
@TestMetadata("innerClassHierarchy.kt")
public void testInnerClassHierarchy() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/innerClassHierarchy.kt");
}
@TestMetadata("javaAccessorConversion.kt")
public void testJavaAccessorConversion() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaAccessorConversion.kt");