langtools/test/tools/javac/generics/inference/4972073/T4972073a.java
author dlsmith
Wed, 14 Dec 2016 17:56:11 -0700
changeset 42819 4ce83e629dc1
parent 25693 b9f1261db3b4
permissions -rw-r--r--
8075793: Source incompatibility for inference using -source 7 Summary: In pre-8 sources, avoid capture variables as inference bounds, consistent with old javac behavior Reviewed-by: vromero, mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
25693
b9f1261db3b4 8048836: .out files for generics tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     2
 * @test    /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug     4972073
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary same interface allowed twice in compound type
25693
b9f1261db3b4 8048836: .out files for generics tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     5
 * @compile/fail/ref=T4972073a.out -XDrawDiagnostics  T4972073a.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
public class T4972073a {
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
    static class D {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
    static interface MyInterface<E> {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
        public String foo();
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    static class MyClass {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    static class Sun1 extends MyClass implements MyInterface<Sun1>, MyInterface<Sun1> {
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
        public String foo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
            return "test";
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
}