match on Bool passes check but codegen rejects it (no if, no working Bool branch) #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A
matchwhose scrutinee is aBoolpassesail check(exit 0) but is rejected at code generation:Repro. A function that does
(match (app gt h 5) (case true (...)) (case _ (...)))—gtreturns aBool, and matching on it typechecks but cannot be lowered.Two problems.
ail checkaccepts a program codegen cannot lower, and the failure is aninternal:-prefixed error at build time rather than a clean diagnostic at check time.if, andmatchonBooldoes not lower, so the only working path is to bypassBoolentirely andmatchoncompare->Ordering(an ADT). That is non-obvious — a competent author (and a frontier LLM) reaches forgt+ match-on-Bool first.Suggested fix. Either (a) make
matchonBoollower (treat its two values as an ADT-style match), or (b) reject it incheckwith a clear message pointing atcompare/Ordering, and/or add anifform. At minimum the error must not beinternal:.Evidence:
experiments/2026-05-12-cross-model-authoring/familiar-vs-unfamiliar/task2-countgt/andformat-findings.md.