test/tools/javac/6717241/T6717241a.java

changeset 0
959103a6100f
child 2525
2eb010b6cb22
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/6717241/T6717241a.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,19 @@
     1.4 +/**
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug     6717241
     1.7 + * @summary some diagnostic argument is prematurely converted into a String object
     1.8 + * @author  Maurizio Cimadamore
     1.9 + * @compile/fail/ref=T6717241a.out -XDrawDiagnostics T6717241a.java
    1.10 + */
    1.11 +
    1.12 +class T6717241a<X extends Object & java.io.Serializable> {
    1.13 +    X x;
    1.14 +    void test() {
    1.15 +        //this will generate a 'cant.resolve'
    1.16 +        Object o = x.v;
    1.17 +        //this will generate a 'cant.resolve.args'
    1.18 +        x.m1(1, "");
    1.19 +        //this will generate a 'cant.resolve.args.params'
    1.20 +        x.<Integer,Double>m2(1, "");
    1.21 +    }
    1.22 +}

mercurial