fix(echo): patch build exhaustiveness gaps from PR #45 + TG-4 echo corpus#46
Merged
Merged
Conversation
Two warnings-as-errors surfaced when compiling the echo/product additions
for the first time on a real OCaml toolchain:
compiler/lib/typecheck.ml — `strand_type_of_ty` had no arms for TProd/TEcho.
compiler/bin/main.ml — the debug token printer had no arms for the 8 new
echo keyword tokens (ECHOCLOSE LOWER RESIDUE PAIR
FST SND ECHOADD ECHOEQ).
Both are straightforward exhaustiveness gaps; the design is preserved.
Both get StrandDefault / print_string "<NAME>" mirroring the nearest
neighbouring cases.
Also extend the TG-4 round-trip corpus in test_roundtrip.ml with one entry
per new echo constructor (echoClose, lower, residue, pair, fst, snd, echoAdd,
echoEq) so the parse/pretty/parse round-trip guarantee is explicitly exercised
for every form added by this PR.
Before: dune build fails; 532 tests (not reached)
After: dune build succeeds; 548/548 tests pass (16 new TG-4 entries)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #45 (merged) added echo/product types to the OCaml pipeline but was authored without a working OCaml/menhir toolchain, so two exhaustiveness gaps slipped through that only surface at compile time:
compiler/lib/typecheck.ml—strand_type_of_ty:TProd/TEchoarms missing →Warning 8promoted to error. Fixed withStrandDefault(same asTWord/TTangle).compiler/bin/main.ml— debug token printer: all 8 echo keyword tokens (ECHOCLOSE,LOWER,RESIDUE,PAIR,FST,SND,ECHOADD,ECHOEQ) absent →Warning 8promoted to error. Fixed withprint_string "<NAME>"mirroring adjacent cases.Also extends the TG-4 round-trip corpus (
test_roundtrip.ml) with one entry per echo constructor so theparse(pretty(e)) = eguarantee is explicitly exercised for every form added by #45.Test plan
dune build— was failing before this PR; passes afterdune test— 548/548 pass (16 new TG-4 echo entries; all prior suites unchanged)echoClose,lower,residue,pair,fst,snd,echoAdd,echoEq— all PASS🤖 Generated with Claude Code