Commit fe1bc86
fix(typecheck): make len/show truly polymorphic schemes (Refs #122)
v2.5/v2.6 (merged in #123) bound `len` and `show` via `bind_var` as
`'a -> Int` / `'a -> String` using a SINGLE SHARED unification tyvar,
not a generalized scheme. The first use pinned it (e.g. `len(name)`
=> tv:=String), so a later `len(ids)` on `[String]` failed with
`Unify TypeMismatch (String, Array[String])`. This blocked any program
mixing `len` over strings and arrays — notably the ubicity#30 storage
port (diagnosed to root cause via an `sb7` minimal repro).
Bind both as generalized schemes via `bind_scheme` (`poly1` helper:
fresh tyvar quantified in `sc_tyvars`, instantiated per call site), so
`len`/`show` are properly polymorphic.
Verified green prior to an environment loss (WSL /tmp wipe): the sb7
repro and the full ubicity storage.affine compiled; the 5 Deno-ESM
harnesses and `dune runtest` (214 tests, unchanged — same 2 pre-existing
E2E Node-CJS vscode failures) all passed. CI re-verifies the build here.
Refs #122 (follow-up to #123; unblocks ubicity#30).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent b00f8e4 commit fe1bc86
1 file changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
1214 | 1223 | | |
1215 | 1224 | | |
1216 | 1225 | | |
| |||
1232 | 1241 | | |
1233 | 1242 | | |
1234 | 1243 | | |
1235 | | - | |
1236 | | - | |
| 1244 | + | |
| 1245 | + | |
1237 | 1246 | | |
1238 | 1247 | | |
1239 | 1248 | | |
| |||
0 commit comments