diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java index 3fe4458826d..5bbfb9498d8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java @@ -142,7 +142,7 @@ public class KtDestructuringDeclarationEntry extends KtNamedDeclarationNotStubbe @NotNull @Override public SearchScope getUseScope() { - KtElement enclosingBlock = KtPsiUtil.getEnclosingElementForLocalDeclaration(this, false); + KtElement enclosingBlock = KtPsiUtil.getEnclosingElementForLocalDeclaration(this, true); if (enclosingBlock != null) return new LocalSearchScope(enclosingBlock); return super.getUseScope(); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java index 9e0cf357981..424083ec3ec 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java @@ -796,7 +796,7 @@ public class KtPsiUtil { return (KtElement) parent; } } - if (current instanceof KtBlockExpression || current instanceof KtParameter) { + if (current instanceof KtBlockExpression || (current instanceof KtParameter && !skipParameters)) { return (KtElement) current; } if (current instanceof KtValueArgument) {