static in interfaces before 1.8 (IDEA-123252)

This commit is contained in:
Anna Kozlova
2014-04-01 17:04:14 +02:00
parent 5f1e0e0d8e
commit 06d6ad7180
2 changed files with 3 additions and 1 deletions
@@ -760,7 +760,8 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
if (!myHolder.hasErrorResults() && method.isConstructor()) {
myHolder.add(HighlightClassUtil.checkThingNotAllowedInInterface(method, aClass));
}
if (!myHolder.hasErrorResults() && method.hasModifierProperty(PsiModifier.DEFAULT)) {
if (!myHolder.hasErrorResults() && (method.hasModifierProperty(PsiModifier.DEFAULT) ||
aClass != null && aClass.isInterface() && method.hasModifierProperty(PsiModifier.STATIC))) {
myHolder.add(HighlightUtil.checkExtensionMethodsFeature(method, myLanguageLevel, myFile));
}
@@ -45,5 +45,6 @@ class UnsupportedFeatures {
interface I {
<error descr="Extension methods are not supported at this language level">default void m() { }</error>
<error descr="Extension methods are not supported at this language level">static void m() { }</error>
}
}