langtools/test/tools/javac/defaultMethods/Neg06.java
author mcimadamore
Sun, 04 Nov 2012 10:59:42 +0000
changeset 14443 91c05eb19277
child 14547 86d8d242b0c4
permissions -rw-r--r--
7192246: Add type-checking support for default methods Summary: Add type-checking support for default methods as per Featherweight-Defender document Reviewed-by: jjg, dlsmith
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14443
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     1
/*
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     3
 * @summary flow analysis is not run on inlined default bodies
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     4
 * @compile/fail/ref=Neg06.out -XDallowDefaultMethods -XDrawDiagnostics Neg06.java
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 Neg06 {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     8
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
     9
    interface A {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    10
        default String m() { C.m(); }
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
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    13
    static class C {
91c05eb19277 7192246: Add type-checking support for default methods
mcimadamore
parents:
diff changeset
    14
        static String m() { return ""; }
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
}