Psi Unifier: Do not unify parameters with block expressions
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ fun foo(): T {
|
||||
|
||||
// SIBLING:
|
||||
fun bar(): T {
|
||||
val a = A()
|
||||
val a = a(A())
|
||||
return a(a)
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user