Summary
An empty match-arm body Pat => {} is a parse error, while a non-empty block body parses fine. Downstream svalinn-gateway source uses empty arms (e.g. None => {}).
Repro
Fails:
module m;
enum Opt { SomeV(Int), NoneV }
pub fn f(o: Opt) -> Int {
match o {
SomeV(v) => { return v; }
NoneV => {}
}
return 0;
}
→ parse error: Syntax error at the } closing the match.
Parses (contrast — non-empty body):
→ Type checking passed.
So the empty {} block body specifically is the limitation.
Question / direction
Is an empty arm body intended-unsupported, or a grammar gap? If empty arms should be legal (unit-valued), the parser should accept => {}; otherwise a clearer diagnostic than a bare "Syntax error" would help downstream authors.
Note
The other downstream-flagged construct, pub extern fn, was checked and is supported — both check and compile succeed — so no issue is filed for it.
Context
Surfaced characterising svalinn-gateway gaps after the constructor-link fix (#138 / #602, ac98c81). Confirmed at main b8ba479.
Summary
An empty match-arm body
Pat => {}is a parse error, while a non-empty block body parses fine. Downstream svalinn-gateway source uses empty arms (e.g.None => {}).Repro
Fails:
→
parse error: Syntax errorat the}closing thematch.Parses (contrast — non-empty body):
→
Type checking passed.So the empty
{}block body specifically is the limitation.Question / direction
Is an empty arm body intended-unsupported, or a grammar gap? If empty arms should be legal (unit-valued), the parser should accept
=> {}; otherwise a clearer diagnostic than a bare "Syntax error" would help downstream authors.Note
The other downstream-flagged construct,
pub extern fn, was checked and is supported — bothcheckandcompilesucceed — so no issue is filed for it.Context
Surfaced characterising svalinn-gateway gaps after the constructor-link fix (#138 / #602,
ac98c81). Confirmed atmainb8ba479.