langtools/test/tools/javac/defaultMethods/Neg07.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=Neg07.out -XDrawDiagnostics Neg07.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
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     7
class Neg07 {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     8
    interface I {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     9
        default int m() { return 1; }
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
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    12
    static class C1 {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    13
        public void m() { } //incompatible return
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
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    16
    static class C2 extends C1 implements I { }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    17
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    18
    static class C3 implements I {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    19
        public void m() { } //incompatible return
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    20
    }
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    21
}