test/tools/javac/NonStaticFieldExpr1.java

changeset 1
9a66ca7c79fa
child 69
82c7aa6fe50a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/NonStaticFieldExpr1.java	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,11 @@
     1.4 +/* @test  /nodynamiccopyright/
     1.5 +   @bug 4087127 4785453
     1.6 +   @author dps
     1.7 +   @summary field: instance access through types is not allowed
     1.8 +
     1.9 +   @run shell NonStaticFieldExpr1.sh
    1.10 +*/
    1.11 +class NonStaticFieldExpr1 {
    1.12 +  public int x;
    1.13 +  int y = NonStaticFieldExpr1.x;                // SHOULD BE ERROR
    1.14 +}

mercurial