langtools/test/tools/javac/NonStaticFieldExpr2.java
author jjg
Fri, 09 Apr 2010 15:39:39 -0700
changeset 5319 63dc7f367a37
parent 863 3113c955a388
child 6150 d055fa8ced62
permissions -rw-r--r--
6942649: add hidden option to identify location and version of javac classes Reviewed-by: darcy

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

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

class NonStaticFieldExpr2 {

  public int x;

  void foo () {
     int z = NonStaticFieldExpr2.x;     // SHOULD BE ERROR
  }
}