[java] improves "unsupported language level" message (IDEA-168859)

This commit is contained in:
Roman Shevchenko
2017-03-06 11:27:27 +01:00
parent f445fe460d
commit 74daf8d522
15 changed files with 252 additions and 214 deletions
@@ -1,14 +1,14 @@
class Test {
interface I {
<error descr="Extension methods are not supported at this language level">static void foo() {}</error>
<error descr="Extension methods are not supported at language level '1.7'">static void foo() {}</error>
}
abstract class IImpl implements I {}
abstract static class IImpl implements I {}
interface I2 extends I {}
{
<error descr="Static interface method invocations are not supported at this language level">I.foo();</error>
IImpl.<error descr="Static interface method invocations are not supported at this language level">foo</error>();
I2.<error descr="Static interface method invocations are not supported at this language level">foo</error>();
I.<error descr="Static interface method calls are not supported at language level '1.7'">foo</error>();
IImpl.<error descr="Static interface method calls are not supported at language level '1.7'">foo</error>();
I2.<error descr="Static interface method calls are not supported at language level '1.7'">foo</error>();
}
}
@@ -0,0 +1,7 @@
import java.io.Serializable;
class IntersectionTypeCast {
void m(Runnable r) {
Object o = <error descr="Intersection types in casts are not supported at language level '1.7'">(Runnable & Serializable)r</error>;
}
}