diff options
Diffstat (limited to 'tests/errors/BadExtension.java')
-rw-r--r-- | tests/errors/BadExtension.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/errors/BadExtension.java b/tests/errors/BadExtension.java new file mode 100644 index 000000000..32bfe8e9c --- /dev/null +++ b/tests/errors/BadExtension.java @@ -0,0 +1,38 @@ +public class BadExtension { } + +abstract class Super { + public final void finalPublic() {} + + public void justPublic() {} + public int intPublic() {} + + public abstract void abstractWithBody() {} //ERROR shouldn't have a body + + public abstract void abstractPublic(); + + public static final void staticFinalPublic() {} +} + +class Sub extends Super { //ERROR must implement abstractPublic + public void finalPublic() {} //ERROR can't override final + void justPublic() {} //ERROR can't override with weaker access + public void intPublic() {} //ERROR can't change the return type + + public static void staticFinalPublic() {} //ERROR can't even override static finals +} + + + +interface I1 { + void m(); +} + +interface I2 { + int m(); +} + +class C12 implements I1, I2 { + public void m() {} //ERROR incompatible return types with I2.m() +} + +interface I12 extends I1, I2 {} //ERROR I1.m() and I2.m() are not compatible |