[FIR] Add problematic resolve test case with delegated super call
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
interface A {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
open class B(private val a: A) : A by a
|
||||
|
||||
class C(a: A) : B(a) {
|
||||
override fun foo() {
|
||||
// Should be resolved to delegated B.foo (no error)
|
||||
super.<!ABSTRACT_SUPER_CALL!>foo<!>()
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
FILE: superCallWithDelegation.kt
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public open class B : R|A| {
|
||||
local final field <$$delegate_0>: R|A|
|
||||
|
||||
public constructor(a: R|A|): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
this@R|/B|.R|<local>/<$$delegate_0>| = R|<local>/a|
|
||||
}
|
||||
|
||||
private final val a: R|A| = R|<local>/a|
|
||||
private get(): R|A|
|
||||
|
||||
}
|
||||
public final class C : R|B| {
|
||||
public constructor(a: R|A|): R|C| {
|
||||
super<R|B|>(R|<local>/a|)
|
||||
}
|
||||
|
||||
public final override fun foo(): R|kotlin/Unit| {
|
||||
this@R|/C|.super<R|B|>.R|/A.foo|()
|
||||
}
|
||||
|
||||
}
|
||||
Generated
+5
@@ -1061,6 +1061,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/someOverridesTest.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("superCallWithDelegation.kt")
|
||||
public void testSuperCallWithDelegation() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("superIsNotAnExpression.kt")
|
||||
public void testSuperIsNotAnExpression() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt");
|
||||
|
||||
+5
@@ -1061,6 +1061,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/someOverridesTest.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("superCallWithDelegation.kt")
|
||||
public void testSuperCallWithDelegation() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("superIsNotAnExpression.kt")
|
||||
public void testSuperIsNotAnExpression() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt");
|
||||
|
||||
Reference in New Issue
Block a user