Partial body resolve: fixed bug

This commit is contained in:
Valentin Kipyatkov
2014-11-18 14:44:35 +03:00
parent e6acc5601c
commit a89c07924d
4 changed files with 17 additions and 1 deletions
@@ -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)
@@ -0,0 +1,3 @@
Resolve target: value-parameter val p: kotlin.Boolean? smart-casted to kotlin.Boolean
Skipped statements:
print(p1!!.hashCode())
@@ -0,0 +1,7 @@
fun foo(p: Boolean?, p1: Any?) {
if (p!!) {
print(p1!!.hashCode())
}
<caret>p.hashCode()
}
@@ -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");