Codegen lookup_ctor_in_pattern type-anchoring #17

Open
opened 2026-05-20 13:21:58 +02:00 by Brummel · 0 comments
Owner

crates/ailang-codegen/src/lib.rs:1790 still walks every module's ctor_index by bare ctor name. Plumbing the scrutinee's qualified Type::Con through pattern lowering would type-anchor it symmetric to the ct.2.2 typecheck-side fix. Not load-bearing (uniqueness is enforced at typecheck), but cleaner.

context: surfaced in iter ct.3 + ct.4 close (2026-05-11).


Verification 2026-06-02: Still VALID. lookup_ctor_in_pattern now at crates/ailang-codegen/src/lib.rs:2385 (was 1790). It still looks up by bare ctor_name: &str against module_ctor_index, with a fallback loop walking every module's ctor_index by bare name — no qualified Type::Con threaded through.

`crates/ailang-codegen/src/lib.rs:1790` still walks every module's ctor_index by bare ctor name. Plumbing the scrutinee's qualified `Type::Con` through pattern lowering would type-anchor it symmetric to the ct.2.2 typecheck-side fix. Not load-bearing (uniqueness is enforced at typecheck), but cleaner. **context:** surfaced in iter ct.3 + ct.4 close (2026-05-11). --- **Verification 2026-06-02:** Still VALID. `lookup_ctor_in_pattern` now at `crates/ailang-codegen/src/lib.rs:2385` (was 1790). It still looks up by bare `ctor_name: &str` against `module_ctor_index`, with a fallback loop walking every module's `ctor_index` by bare name — no qualified `Type::Con` threaded through.
Sign in to join this conversation.