test/tools/javac/generics/inference/6838943/T6838943.java

Tue, 06 Mar 2012 13:28:05 +0000

author
mcimadamore
date
Tue, 06 Mar 2012 13:28:05 +0000
changeset 1219
48ee63caaa93
parent 0
959103a6100f
permissions
-rw-r--r--

7144506: Attr.checkMethod should be called after inference variables have been fixed
Summary: Unify post-inference sanity check with Attr.checkMethod
Reviewed-by: jjg, dlsmith

aoqi@0 1 /**
aoqi@0 2 * @test /nodynamiccopyright/
aoqi@0 3 * @bug 6838943
aoqi@0 4 * @summary inference: javac is not handling type-variable substitution properly
aoqi@0 5 * @compile/fail/ref=T6838943.out -XDrawDiagnostics T6838943.java
aoqi@0 6 */
aoqi@0 7 class T6838943 {
aoqi@0 8 static class A<X> {}
aoqi@0 9 static class B {}
aoqi@0 10 static class C<X> {
aoqi@0 11 <Z> void m(X x, Z z) {
aoqi@0 12 C<A<Z>> c = new C<A<Z>>();
aoqi@0 13 c.m(new A<B>(), new B()); //should fail
aoqi@0 14 }
aoqi@0 15 }
aoqi@0 16 }

mercurial