roc icon indicating copy to clipboard operation
roc copied to clipboard

Match branch pattern guards are not parsed

Open JRI98 opened this issue 6 months ago • 2 comments

match value {
    x if x > 0 => "positive: ${x.to_str()}",
    x if x < 0 => "negative: ${x.to_str()}",
    _ => "other",
}

JRI98 avatar Jul 18 '25 20:07 JRI98

Note the string interpolation here should be ${Num.to_str(x)} or maybe ${x.to_str()}

lukewilliamboswell avatar Jul 18 '25 21:07 lukewilliamboswell

I copied it from an old example. Good catch.

JRI98 avatar Jul 18 '25 21:07 JRI98