FastScriptReload icon indicating copy to clipboard operation
FastScriptReload copied to clipboard

Incorrect rewrite for switch assignment (using new language features)

Open handzlikchris opened this issue 2 years ago • 0 comments

        /* bool drawin = corner switch {
 */ //Auto-excluded to prevent exceptions - see docs            PathCorner.UpperLeft => drawBorder[3],
            PathCorner.UpperRight => drawBorder[0],
            PathCorner.LowerRight => drawBorder[1],
            PathCorner.LowerLeft => drawBorder[2],
             => true,

So it thorws an "; missing" error, due to its not excluding enough.

This is the original:


        bool drawin = corner switch {
            PathCorner.UpperLeft => drawBorder[3],
            PathCorner.UpperRight => drawBorder[0],
            PathCorner.LowerRight => drawBorder[1],
            PathCorner.LowerLeft => drawBorder[2],
             => true,
        };

handzlikchris avatar Sep 26 '23 12:09 handzlikchris