FIR2IR: Fix smart-cast approximation implicit receiver
Previously, it was always cast to the first type of smart cast variants list independently of callee symbol that might be present in the member scope of a different type
This commit is contained in:
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -24792,6 +24792,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complexImplicitReceiver.kt")
|
||||
public void testComplexImplicitReceiver() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("falseSmartCast.kt")
|
||||
public void testFalseSmartCast() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
|
||||
|
||||
Generated
+5
@@ -24792,6 +24792,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complexImplicitReceiver.kt")
|
||||
public void testComplexImplicitReceiver() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("falseSmartCast.kt")
|
||||
public void testFalseSmartCast() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
|
||||
|
||||
Generated
+5
@@ -24757,6 +24757,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complexImplicitReceiver.kt")
|
||||
public void testComplexImplicitReceiver() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("falseSmartCast.kt")
|
||||
public void testFalseSmartCast() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -13261,6 +13261,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complexImplicitReceiver.kt")
|
||||
public void testComplexImplicitReceiver() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("falseSmartCast.kt")
|
||||
public void testFalseSmartCast() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
|
||||
|
||||
Reference in New Issue
Block a user