langtools/test/tools/javac/NonStaticFieldExpr3.java
author peterz
Fri, 28 May 2010 13:32:40 +0400
changeset 5594 3db39773da2e
parent 863 3113c955a388
child 6150 d055fa8ced62
permissions -rw-r--r--
6954231: SynthTextPaneUI.installUI() doesn't set component to opaque even if prop was not set by client progr Reviewed-by: alexp

/* @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
}