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

public final class Ex3 {
    public static int foo() { return 123; }
    public static void main (String [] args) {
        Code<Integer> x = <| 0 |>;
        Code<Void> cv = <| { 
            Integer y = foo();
            // x = <| y |>;
            Integer z = `(x = <| y |>);
            // ^ it should complain here
            // local variable x accessed inside brackets needs to be final
            // local variable y accessed inside brackets needs to be final
            System.out.println("y = "+y+", z = "+z);
        } |>;
        cv.run();
        System.out.println("x.run() = "+x.run());
    }
}
