langtools/test/tools/javac/defaultMethods/Neg11.java
author vasya
Mon, 14 Dec 2015 20:18:19 +0100
changeset 34752 9c262a013456
parent 19934 1d8232b1aa18
permissions -rw-r--r--
8145342: Some copyright notices are inconsistently and ill formatted Summary: Adjusted formatting of copyright notices. Reviewed-by: darcy, alundblad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19934
1d8232b1aa18 8005222: Fixed bugs should have tests with bugid in @bug tag
jfranck
parents: 14547
diff changeset
     1
/* @test /nodynamiccopyright/
1d8232b1aa18 8005222: Fixed bugs should have tests with bugid in @bug tag
jfranck
parents: 14547
diff changeset
     2
 * @bug 7192246
14443
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     3
 * @summary check that default overrides are properly type-checked
14547
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents: 14443
diff changeset
     4
 * @compile/fail/ref=Neg11.out -XDrawDiagnostics Neg11.java
14443
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     5
 */
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     6
class Neg11 {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     7
    interface I {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     8
        default void m() { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     9
    }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    10
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    11
    static class C1 {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    12
        public void m() throws Exception { } //bad throws
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    13
    }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    14
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    15
    static class C2 extends C1 implements I { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    16
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    17
    static class C3 implements I {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    18
        public void m() throws Exception { } //bad throws
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    19
    }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    20
}