## Current behavior Enum variant shorthand in a generic argument position can work in `main`, but fail in ordinary helper functions that return a value. Minimal repro: ```with type D = | X | Y fn make_vec -> Vec[D]: let xs: Vec[D] = Vec.new() xs.push(.X) xs fn main: let _ = make_vec() ``` `with check` fails with: ```text error: enum variant shorthand does not match expected enum type --> test.w:7:13 7 | xs.push(.X) | ^^ ``` ## Control cases These both work: 1. Qualified syntax inside the helper: ```with fn make_vec -> Vec[D]: let xs: Vec[D] = Vec.new() xs.push(D.X) xs ``` 2. The shorthand form inside `main`: ```with fn main: let xs: Vec[D] = Vec.new() xs.push(.X) ``` So the issue is not `Vec.push` or enums in general. It is the type inference/lowering for shorthand enum variants inside non-void helper functions. ## Expected behavior `.X` should compile anywhere the expected type is known, including inside helpers that return a value. ## Why this matters This currently blocks builders/helpers that accumulate enum-typed values and then return a composite result.
Activity
Fix enum variant shorthand in non-void functions (fixes #36)