IDEA-230701 IDEA doesn't resolve pattern variable defined in labeled scope

GitOrigin-RevId: afd36dfb5a20200bcab13a0efdc8ddf4884d959e
This commit is contained in:
Tagir Valeev
2020-01-22 10:38:13 +00:00
committed by intellij-monorepo-bot
parent ff0b24139e
commit 681a58ab7b
2 changed files with 9 additions and 1 deletions
@@ -102,7 +102,7 @@ public class PsiLabeledStatementImpl extends CompositePsiElement implements PsiL
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
if (lastParent != null && lastParent.getParent() != this){
if (lastParent == null || lastParent.getParent() != this){
PsiElement[] children = getChildren();
for (PsiElement aChildren : children) {
if (!aChildren.processDeclarations(processor, state, null, place)) {
@@ -117,4 +117,12 @@ class X {
}
System.out.println("Found: "+s.trim());
}
void testLabel() {
Object o = "hello";
L0: if(!(o instanceof String s)) {
return;
}
System.out.println(s.length());
}
}