Propagate inference session from local context into property resolvers

^KT-48633 Fixed
This commit is contained in:
Victor Petukhov
2021-10-04 12:00:14 +03:00
parent 43e9c1223a
commit d50eba62bd
10 changed files with 60 additions and 4 deletions
@@ -18483,6 +18483,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@Test
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@Test
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
@@ -171,7 +171,7 @@ protected constructor(
propertyDeclaration,
trace,
c.declarationScopeProvider.getOuterDataFlowInfoForDeclaration(propertyDeclaration),
InferenceSession.default
c.inferenceSession ?: InferenceSession.default
)
result.add(propertyDescriptor)
}
@@ -184,7 +184,7 @@ protected constructor(
entry,
trace,
c.declarationScopeProvider.getOuterDataFlowInfoForDeclaration(entry),
InferenceSession.default
c.inferenceSession ?: InferenceSession.default
)
result.add(propertyDescriptor)
}
@@ -48,7 +48,6 @@ internal class TowerDataElementsForName3() {
}
}
// mute due to KT-48633
//internal class TowerDataElementsForName4() {
// @OptIn(ExperimentalStdlibApi::class)
// val reversedFilteredLocalScopes = buildList l1@ {
@@ -72,4 +71,4 @@ fun box(): String {
val x3 = TowerDataElementsForName3().reversedFilteredLocalScopes
// val x4 = TowerDataElementsForName4().reversedFilteredLocalScopes
return "OK"
}
}
@@ -0,0 +1,19 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
class TowerDataElementsForName() {
@OptIn(ExperimentalStdlibApi::class)
val reversedFilteredLocalScopes = buildList {
class Foo {
val reversedFilteredLocalScopes = {
add("OK")
}
}
Foo().reversedFilteredLocalScopes()
}
}
fun box(): String {
return TowerDataElementsForName().reversedFilteredLocalScopes[0]
}
@@ -18357,6 +18357,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@Test
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@Test
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
@@ -18483,6 +18483,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@Test
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@Test
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
@@ -15221,6 +15221,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
@@ -13285,6 +13285,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
@@ -12691,6 +12691,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");
@@ -14382,6 +14382,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
@Test
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48633.kt");
}
@TestMetadata("labaledCall.kt")
public void testLabaledCall() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/labaledCall.kt");