langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_4.java
author robm
Tue, 13 Sep 2016 14:47:29 +0100
changeset 40938 5b0977acc842
parent 27119 b80b6a2e137f
permissions -rw-r--r--
6947916: JarURLConnection does not handle useCaches correctly Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
27119
b80b6a2e137f 8058410: Group 10b: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 4094658
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary Test enforcement of JLS 6.6.1 and 6.6.2 rules requiring that
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * the type to which a component member belongs be accessible in qualified
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * names.
27119
b80b6a2e137f 8058410: Group 10b: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     7
 * @compile/fail/ref=QualifiedAccess_4.out -XDrawDiagnostics QualifiedAccess_4.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
import pack1.P1;
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
class CMain {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
    class Foo {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        class Bar {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
    Foo.Bar yy  = x.new Foo.Bar();      // ERROR - Type in qualified 'new' must be unqualified
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
}