diff --git a/idea/ide-common/src/org/jetbrains/jet/lang/resolve/lazy/PartialBodyResolveFilter.kt b/idea/ide-common/src/org/jetbrains/jet/lang/resolve/lazy/PartialBodyResolveFilter.kt index e830bd390c7..561549959ae 100644 --- a/idea/ide-common/src/org/jetbrains/jet/lang/resolve/lazy/PartialBodyResolveFilter.kt +++ b/idea/ide-common/src/org/jetbrains/jet/lang/resolve/lazy/PartialBodyResolveFilter.kt @@ -141,7 +141,7 @@ class PartialBodyResolveFilter(elementToResolve: JetElement, private val body: J } } - condition.acceptChildren(this) + condition.accept(this) if (thenBranch != null && elseBranch != null) { val thenCasts = potentialSmartCastPlaces(thenBranch, filter) diff --git a/idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.dump b/idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.dump new file mode 100644 index 00000000000..514abfa40ed --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.dump @@ -0,0 +1,3 @@ +Resolve target: value-parameter val p: kotlin.Boolean? smart-casted to kotlin.Boolean +Skipped statements: +print(p1!!.hashCode()) diff --git a/idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.kt b/idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.kt new file mode 100644 index 00000000000..2416d371c67 --- /dev/null +++ b/idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.kt @@ -0,0 +1,7 @@ +fun foo(p: Boolean?, p1: Any?) { + if (p!!) { + print(p1!!.hashCode()) + } + + p.hashCode() +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java b/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java index 05c67cb8214..2ae898ce38a 100644 --- a/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/resolve/PartialBodyResolveTestGenerated.java @@ -48,6 +48,12 @@ public class PartialBodyResolveTestGenerated extends AbstractPartialBodyResolveT doTest(fileName); } + @TestMetadata("BangBangInIfCondition.kt") + public void testBangBangInIfCondition() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/BangBangInIfCondition.kt"); + doTest(fileName); + } + @TestMetadata("DeclarationsBefore.kt") public void testDeclarationsBefore() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/partialBodyResolve/DeclarationsBefore.kt");