IDEA-136162 (type annotations in anonymous classes)

This commit is contained in:
Roman Shevchenko
2015-02-09 19:23:15 +01:00
parent 041a7c1c3d
commit 2c738eea52
2 changed files with 6 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -132,7 +132,10 @@ public class PsiAnnotationImpl extends JavaStubPsiElement<PsiAnnotationStub> imp
}
else if (parent instanceof PsiJavaCodeReferenceElement) {
PsiElement ctx = PsiTreeUtil.skipParentsOfType(parent, PsiJavaCodeReferenceElement.class);
if (ctx instanceof PsiReferenceList || ctx instanceof PsiNewExpression || ctx instanceof PsiTypeElement) {
if (ctx instanceof PsiReferenceList ||
ctx instanceof PsiNewExpression ||
ctx instanceof PsiTypeElement ||
ctx instanceof PsiAnonymousClass) {
return new PsiClassReferenceType((PsiJavaCodeReferenceElement)parent, null);
}
}
@@ -59,6 +59,7 @@ class Outer {
{
new @TA Object();
new @TA ArrayList<String>();
new @TA Runnable() { public void run() { } }.run();
ArrayList<String> var = new <String> @TA ArrayList();
new @TA Outer().new @TA Middle();