spicy icon indicating copy to clipboard operation
spicy copied to clipboard

Allow use of `&synchronize` on unit switch fields

Open bbannier opened this issue 4 years ago • 0 comments

We currently do not allow the use of &synchronize on unit switch fields, e.g., the following is not possible:

public type X = unit {
    switch {
        -> a: b"A" &synchronize;
        -> b: b"B" &synchronize;
        -> c: b"C" &synchronize;
    };
};

We should consider allowing this if

  1. all cases &synchronize

  2. or maybe the switch itself is &synchronize, e.g.,

    public type X = unit {
        switch {
            -> a: b"A";
            -> b: b"B";
            -> c: b"C";
        } &synchronize;
    };
    

bbannier avatar Feb 21 '22 20:02 bbannier