FIR: Fix forEach resolution within local class

This commit is contained in:
Denis.Zharkov
2021-10-11 13:18:09 +03:00
committed by TeamCityServer
parent 056657525e
commit cac69edff2
6 changed files with 50 additions and 0 deletions
@@ -36799,6 +36799,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/resolve"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("forEachInLocalClass.kt")
public void testForEachInLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/forEachInLocalClass.kt");
}
@Test
@TestMetadata("hidesMembers.kt")
public void testHidesMembers() throws Exception {
@@ -36799,6 +36799,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/resolve"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("forEachInLocalClass.kt")
public void testForEachInLocalClass() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/forEachInLocalClass.kt");
}
@Test
@TestMetadata("hidesMembers.kt")
public void testHidesMembers() throws Exception {
@@ -333,6 +333,7 @@ class BodyResolveContext(
): BodyResolveContext =
BodyResolveContext(returnTypeCalculator, dataFlowAnalyzerContext, targetedLocalClasses, outerLocalClassForNested).apply {
file = this@BodyResolveContext.file
fileImportsScope += this@BodyResolveContext.fileImportsScope
towerDataContextForAnonymousFunctions.putAll(this@BodyResolveContext.towerDataContextForAnonymousFunctions)
towerDataContextForCallableReferences.putAll(this@BodyResolveContext.towerDataContextForCallableReferences)
containers = this@BodyResolveContext.containers