FIR body resolve context: fix accessor scope handling
This commit is contained in:
+3
-1
@@ -1226,7 +1226,9 @@ class Fir2IrDeclarationStorage(
|
||||
|
||||
private fun getIrVariableSymbol(firVariable: FirVariable<*>): IrVariableSymbol {
|
||||
return localStorage.getVariable(firVariable)?.symbol
|
||||
?: throw IllegalArgumentException("Cannot find variable ${firVariable.render()} in local storage")
|
||||
?: run {
|
||||
throw IllegalArgumentException("Cannot find variable ${firVariable.render()} in local storage")
|
||||
}
|
||||
}
|
||||
|
||||
fun getIrValueSymbol(firVariableSymbol: FirVariableSymbol<*>): IrSymbol {
|
||||
|
||||
Generated
+6
@@ -2110,6 +2110,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
||||
runTest("compiler/testData/ir/irText/firProblems/AnnotationLoader.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ArrayMap.kt")
|
||||
public void testArrayMap() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/firProblems/ArrayMap.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("candidateSymbol.kt")
|
||||
public void testCandidateSymbol() throws Exception {
|
||||
|
||||
+5
-1
@@ -606,7 +606,11 @@ class BodyResolveContext(
|
||||
f: () -> T
|
||||
): T {
|
||||
if (accessor is FirDefaultPropertyAccessor || accessor.body == null) {
|
||||
return withContainer(accessor, f)
|
||||
return if (accessor.isGetter) withContainer(accessor, f)
|
||||
else withTowerDataCleanup {
|
||||
addLocalScope(FirLocalScope())
|
||||
withContainer(accessor, f)
|
||||
}
|
||||
}
|
||||
return withTowerDataCleanup {
|
||||
val receiverTypeRef = property.receiverTypeRef
|
||||
|
||||
Reference in New Issue
Block a user