diff --git a/CHANGELOG.md b/CHANGELOG.md index 7067f7a..7073ec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- reject broad universes (`string`, `number`, template literals) and + value/stringification collisions (`true | "true"`, `1 | "1"`) at the factory +- type handler parameters by the matched member (`Member`), so a + standalone `"true"` universe is typed `"true"` rather than `true` + ## [0.6.0] - 2026-09-22 - add `getTaggedUnionMatcher` / `getTaggedUnionMatcherW` for discriminated unions diff --git a/backlog.tasks b/backlog.tasks index e457520..83a08ae 100644 --- a/backlog.tasks +++ b/backlog.tasks @@ -37,12 +37,12 @@ Testing: ✔ Rewrite `src/util/__tests__/lsp-completion.ts` onto `createMessageConnection` and typed requests @done ✔ Update `development/testing.md § Autocomplete` for the new client @done ✔ Run `npm run verify` and check the task off @done -☐ Test a literal union widened with `(string & {})` — `"red" | "green" | "yellow" | (string & {})` @medium - → autocomplete should still offer the literals; arbitrary strings stay assignable and fall through to the fallback -☐ Type hole when using broad types like string as a universe @high - ☐ handlers cannot be exhaustive, yet it is possible to not have a fallback - ☐ one test even exploits this, I think for a negative test - ☐ does the same type hole exist for tagged-union matchers or primitive-union matchers only? +✘ Test a literal union widened with `(string & {})` — `"red" | "green" | "yellow" | (string & {})` @medium @cancelled + → broad universes are rejected; the rejection is covered by the broad-universe gate tests +✔ Type hole when using broad types like string as a universe @high @done + → decided: broad universes are rejected at the factory, so the exhaustive overload can always be proven + → value/stringification collisions (`true | "true"`, `1 | "1"`) are rejected too; handler params are typed by `Member` + → see development/library.md § Supported universes Matcher: ✔ Clean up: adopt the 3-overload matcher (`src/prototype-ac2.ts`) and delete the prototypes @high @done