import edu.rice.cs.mint.runtime.*;

public final class CspSample3 {
    public static class Foo {
        public int fooField = 111;
        public void m() {
            System.out.println("m()");
        }
    }
    public int field = 222;
    public void run() {    
        int local = 0;
        Code<Void> c = <| {
            //local = 1; // error
            //field = 222; // error
            //this.field = 222; // error
            //CspSample3.field = 222; // error
            //CspSample3.this.field = 222; // error
            
            Foo f = new Foo() {
                public void m() {
                    fooField = 222;
                }
            };
            f.m();
            System.out.println(f.fooField);
        } |>;
        c.run ();
    }
    
    public static void main (String [] args) {
        new CspSample3().run();
        /*
         Foo f = new Foo() {
         public void m() {
         fooField = 222;
         }
         };
         f.m();
         System.out.println(f.fooField);
         */
    }
}
