Psi Unifier: Do not unify parameters with block expressions

This commit is contained in:
Alexey Sedunov
2015-11-20 14:16:11 +03:00
parent 741489f4a5
commit 6e8acc6453
4 changed files with 5 additions and 5 deletions
@@ -823,7 +823,7 @@ public class KotlinPsiUnifier(
if (targetElementUnwrapped == patternElementUnwrapped) return MATCHED
if (targetElementUnwrapped == null || patternElementUnwrapped == null) return UNMATCHED
if (!checkEquivalence) {
if (!checkEquivalence && targetElementUnwrapped !is KtBlockExpression) {
val referencedPatternDescriptor = (patternElementUnwrapped as? KtReferenceExpression)?.let {
it.bindingContext[BindingContext.REFERENCE_TARGET, it]
}
@@ -2,7 +2,7 @@
// PARAM_DESCRIPTOR: val b: kotlin.Int defined in foo
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
val b: Int = i(1)
return when (a + b) {
0 -> i(b)
1 -> -b
@@ -9,7 +9,7 @@ fun foo(): T {
// SIBLING:
fun bar(): T {
val a = A()
val a = a(A())
return a(a)
}
}
@@ -1,8 +1,8 @@
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
// PARAM_TYPES: kotlin.Int, Number, Comparable<Int>, java.io.Serializable, Any
fun foo(a: Int): String {
val x = "-$a"
val y = "x${a}y"
val x = "-${i(a)}"
val y = "x${i(a)}y"
val z = "x$ay"
return "abc${i(a)}def"
}