java 8: forbid super in static methods

This commit is contained in:
anna
2013-11-05 12:23:19 +01:00
parent dda9d7dbb1
commit ae7e30edee
3 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
interface Super
{
default void method()
{
System.out.println("Super.method()");
}
}
interface Sub extends Super {
static void foo() {
<error descr="'Super' is not an enclosing class">Super.super</error>.method();
}
}