/**
* @test /nodynamiccopyright/
* @bug 4094658 4785453
* @summary Test enforcement of JLS 6.6.1 and 6.6.2 rules requiring that
* the type to which a component member belongs be accessible in qualified
* names.
*
* @compile/fail/ref=QualifiedAccess_3.out -XDrawDiagnostics QualifiedAccess_3.java
*/
class CMain {
class Foo {
class Bar {}
}
static class Baz {
private static class Quux {
static class Quem {}
}
}
// These are all OK.
void test() {
// These are NOT errors, and should NOT be detected, as observed.
/*------------------------------------*
Baz.Quux z = null;
Baz.Quux.Quem y = null;
*------------------------------------*/
// The type of the expression from which a component
// is selected must be accessible.
}
}