test/tools/javac/lambda/FunctionalInterfaceAnno.java

Fri, 22 Mar 2013 12:43:09 +0000

author
mcimadamore
date
Fri, 22 Mar 2013 12:43:09 +0000
changeset 1655
c6728c9addff
parent 0
959103a6100f
permissions
-rw-r--r--

8010303: Graph inference: missing incorporation step causes spurious inference error
Summary: Multiple equality constraints on inference vars are not used to generate new inference constraints
Reviewed-by: jjg

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @summary smoke test for functional interface annotation
     4  * @compile/fail/ref=FunctionalInterfaceAnno.out -XDrawDiagnostics FunctionalInterfaceAnno.java
     5  */
     6 class FunctionalInterfaceAnno {
     7     @FunctionalInterface
     8     static class A { } //not an interface
    10     @FunctionalInterface
    11     static abstract class B { } //not an interface
    13     @FunctionalInterface
    14     enum C { } //not an interface
    16     @FunctionalInterface
    17     @interface D { } //not an interface
    19     @FunctionalInterface
    20     interface E { } //no abstracts
    22     @FunctionalInterface
    23     interface F { default void m() { } } //no abstracts
    25     @FunctionalInterface
    26     interface G { String toString(); } //no abstracts
    28     @FunctionalInterface
    29     interface H { void m(); void n(); } //incompatible abstracts
    31     @FunctionalInterface
    32     interface I { void m(); } //ok
    33 }

mercurial