mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
enum constants should be checked to implement enum interfaces
This commit is contained in:
@@ -45,7 +45,7 @@ public class ClassUtil {
|
||||
@Nullable
|
||||
public static PsiMethod getAnyMethodToImplement(@NotNull PsiClass aClass) {
|
||||
final PsiClass superClass = aClass instanceof PsiAnonymousClass ? PsiUtil.resolveClassInClassTypeOnly(((PsiAnonymousClass)aClass).getBaseClassType()) : aClass.getSuperClass();
|
||||
if (superClass != null && !superClass.hasModifierProperty(PsiModifier.ABSTRACT) && aClass.getImplementsListTypes().length == 0) {
|
||||
if (superClass != null && !superClass.hasModifierProperty(PsiModifier.ABSTRACT) && !superClass.isEnum() && aClass.getImplementsListTypes().length == 0) {
|
||||
return null;
|
||||
}
|
||||
Set<PsiMethod> alreadyImplemented = new THashSet<PsiMethod>();
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
interface A {
|
||||
void m();
|
||||
}
|
||||
|
||||
enum E implements A {
|
||||
<error descr="Class 'Anonymous class derived from E' must implement abstract method 'm()' in 'A'">F</error>() {};
|
||||
}
|
||||
+4
@@ -78,4 +78,8 @@ public class LightAdvHighlightingJdk6Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testThisInArgListOfAnonymous() {
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
public void testEnumConstantWithoutInterfaceImplementation() throws Exception {
|
||||
doTest(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user