TY7 De Morgan narrowing + pattern-binder typing #33
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/033-ty7-de-morgan-narrowing-pattern-binder-typing"
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?
TY7 De Morgan narrowing + pattern-binder typing
Along the way:
Touches 11 files:
docs/impl/type-system/TY7-exhaustive-match-and-narrowing.md,src/rust/crates/ck_cktest/src/pipeline.rs,src/rust/crates/ck_types/src/check.rs,src/rust/crates/ck_types/src/driver.rs,src/rust/crates/ck_types/src/lib.rs,src/rust/crates/ck_types/src/match_check.rsand 5 more.Good. Small enough to read in one sitting, and
src/rust/crates/ck_types/src/match_check.rsis easier to follow than it was.@ -473,0 +525,4 @@} => {cx.results.locals.insert(*local, scrutinee_ty.clone());}_ => {}The catch-all arm means a variant added later compiles and lands here without a word. Can the match on
_name every variant so the compiler tells us?, at src/rust/crates/ck_types/src/match_check.rs:528.Named them all. A new variant is a compile error in
src/rust/crates/ck_types/src/match_check.rsnow, which is where we want to find out.Read it too. No objection to
src/rust/crates/ck_types/src/match_check.rs.