You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Separate variant layouts from constructor matching plans
The runtime representation of a variant is declaration-level data, while the decision for a particular match depends on its arms, actions, default, and exhaustiveness. Represent the two separately:
- Variant_runtime.layout stores immutable constructor representations and declaration-level matching facts computed once.
- Type_variant stores an abstract one-shot layout_ref. Recursive declarations allocate it while provisional, then complete the same identity after the recursive group is available.
- Ordinary constructor descriptions address their representation by layout reference and source position, removing repeated name lookup and duplicated layout storage.
- Matching builds one occurrence-specific constructor_matching_plan in combine_constructor and immediately lowers it to existing Lambda forms. No Lam or Lambda expression form is added.
- Construction, matching, and type-based optimization consume the canonical representation instead of reinterpreting runtime attributes.
Rename Transparent to Unboxed and variant_dispatch to matching_facts so the remaining terms describe the represented facts rather than an implementation strategy.
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
0 commit comments