LVTI: warnings for var as class name (IDEA-178868)

This commit is contained in:
Anna Kozlova
2017-09-18 19:05:20 +03:00
parent a1439d6775
commit 29bc5a12c0
7 changed files with 27 additions and 3 deletions
@@ -0,0 +1 @@
class <warning descr="Usage of 'var' as class name might not be supported in releases after java 9">var</warning> {}
@@ -0,0 +1,5 @@
class Main {
class <error descr="'var' is a restricted local variable type and cannot be used for type declarations">var</error> {}
<<error descr="'var' is a restricted local variable type and cannot be used for type declarations">var</error> extends String> void foo() {}
}
@@ -45,6 +45,7 @@ public class LightAdvHighlightingJdk8Test extends LightDaemonAnalyzerTestCase {
public void testLambdaExpressions() { doTest(false, true); }
public void testUnsupportedFeatures() { doTest(false, false); }
public void testModulesNotSupported() { doTest(false, false); }
public void testVarClassesWarning() { doTest(true, false); }
public void testTooManyVarargsPolyArguments() {
doTest(true, false);
@@ -35,9 +35,8 @@ public class LightAdvLVTIHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
}
public void testSimpleAvailability() {
doTest();
}
public void testSimpleAvailability() { doTest(); }
public void testVarClassNameConflicts() { doTest(); }
@Override
protected Sdk getProjectJDK() {