langtools/test/tools/javac/NonStaticFieldExpr3.java
author jjg
Thu, 10 Jul 2008 11:25:23 -0700
changeset 863 3113c955a388
parent 10 06bc494ca11e
child 6150 d055fa8ced62
permissions -rw-r--r--
6724327: eliminate use of shell tests for simple golden file tests Reviewed-by: darcy

/* @test  /nodynamiccopyright/
   @bug 4087127 4785453
   @author dps
   @summary class: instance access through types is not allowed

   @compile/fail/ref=NonStaticFieldExpr3.out -XDrawDiagnostics -XDstdout NonStaticFieldExpr3.java
*/

class NonStaticFieldExpr3 {
  public int x;
}

class Subclass extends NonStaticFieldExpr3 {
  int a = NonStaticFieldExpr3.x;      // SHOULD BE ERROR
}