[LL FIR] fix lazy resolution of member property statuses for anonymous objects
Previously, statuses of superclass which are not local was not ignored Sometimes it worked in the IDE by calling lazyResolveToPhase which is a violation of the lazy resolution contract ^KT-54890
This commit is contained in:
+5
@@ -2768,6 +2768,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/localClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonObject.kt")
|
||||
public void testAnonObject() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/anonObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousInAnonymous.kt")
|
||||
public void testAnonymousInAnonymous() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/anonymousInAnonymous.kt");
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
FILE: a.kt
|
||||
public final object A : R|kotlin/Any| {
|
||||
private constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val O: R|B| = object : R|B| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|B|>()
|
||||
}
|
||||
|
||||
protected final override val message: R|kotlin/String| = String(expression expected)
|
||||
protected get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
|
||||
public get(): R|B|
|
||||
|
||||
}
|
||||
FILE: b.kt
|
||||
public abstract class B : R|kotlin/Any| {
|
||||
public constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
protected abstract val message: R|kotlin/String|
|
||||
protected get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// FILE: a.kt
|
||||
object A {
|
||||
val O = object : B() {
|
||||
override val message = "expression expected"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
abstract class B {
|
||||
protected abstract val message: String
|
||||
}
|
||||
+6
@@ -3145,6 +3145,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/localClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anonObject.kt")
|
||||
public void testAnonObject() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/anonObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anonymousInAnonymous.kt")
|
||||
public void testAnonymousInAnonymous() throws Exception {
|
||||
|
||||
+6
@@ -3145,6 +3145,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/localClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anonObject.kt")
|
||||
public void testAnonObject() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/anonObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anonymousInAnonymous.kt")
|
||||
public void testAnonymousInAnonymous() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user