package sub;
public class BracketSampleInSub {
    public static void voidFn() { System.out.println("ok"); }
    public static void main(String[] args) {
        // works: prints 123
        System.out.println((<|123|>).run());
        
        // works: prints nothing
        <|123|>.run();
        
        // works: prints 123
        edu.rice.cs.mint.runtime.Code<Integer> c = <|123|>;
        System.out.println(c.run());
        
        // works: prints out foo!\nbar!
        edu.rice.cs.mint.runtime.Code<Void> c2 = <| {
            System.out.println("foo!");
            System.out.println("bar!");
        } |>;
        c2.run();
        
        // works: return type has array type
        String[] sarr = <| new String[] {"foo","bar"} |>.run();
        System.out.println(java.util.Arrays.toString(sarr));
        
        // works: must qualify voidFn with BracketSampleInSub though
        edu.rice.cs.mint.runtime.Code<Void> c3 = <| { BracketSampleInSub.voidFn(); } |>;
        c3.run();
    }
}
