diff --git a/idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.dump b/idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.dump new file mode 100644 index 00000000000..750d74d4909 --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.dump @@ -0,0 +1,11 @@ +Expression type:kotlin.String +---------------------------------------------- +fun foo(x: Any) { + if (x is String) { + print(System.getProperty("abc")!!) + /* STATEMENT DELETED: println() */ + } + else { + /* STATEMENT DELETED: println() */ + } +} diff --git a/idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.kt b/idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.kt new file mode 100644 index 00000000000..b08bdca1b89 --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.kt @@ -0,0 +1,9 @@ +fun foo(x: Any) { + if (x is String) { + print(System.getProperty("abc")!!) + println() + } + else { + println() + } +} diff --git a/idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.dump b/idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.dump new file mode 100644 index 00000000000..736d009929a --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.dump @@ -0,0 +1,11 @@ +Expression type:kotlin.Int +---------------------------------------------- +fun foo(x: Any) { + if (x is String) { + System.getProperty("abc".substring(1)) + /* STATEMENT DELETED: println() */ + } + else { + /* STATEMENT DELETED: println() */ + } +} diff --git a/idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.kt b/idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.kt new file mode 100644 index 00000000000..b969efab606 --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.kt @@ -0,0 +1,9 @@ +fun foo(x: Any) { + if (x is String) { + System.getProperty("abc".substring(1)) + println() + } + else { + println() + } +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/resolve/PartialBodyResolveTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/resolve/PartialBodyResolveTestGenerated.java index af602cfdb22..a21be3e89d3 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/resolve/PartialBodyResolveTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/resolve/PartialBodyResolveTestGenerated.java @@ -54,6 +54,12 @@ public class PartialBodyResolveTestGenerated extends AbstractPartialBodyResolveT doTest(fileName); } + @TestMetadata("BangBangHasPlatformTypeBug.kt") + public void testBangBangHasPlatformTypeBug() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/BangBangHasPlatformTypeBug.kt"); + doTest(fileName); + } + @TestMetadata("BangBangInIfCondition.kt") public void testBangBangInIfCondition() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.kt"); @@ -252,6 +258,12 @@ public class PartialBodyResolveTestGenerated extends AbstractPartialBodyResolveT doTest(fileName); } + @TestMetadata("IntConstantTypeBug.kt") + public void testIntConstantTypeBug() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/IntConstantTypeBug.kt"); + doTest(fileName); + } + @TestMetadata("LabeledBreak.kt") public void testLabeledBreak() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/LabeledBreak.kt");