Commit a45268d
committed
fix: cross-module imports for stdlib (ADR-011) + module builtin seeding (#135)
The ruled ADR-011 model is explicit `use module::{...}`. io.affine
needs string.affine's split/join. Three coupled fixes:
1. resolve.ml: factor builtin seeding into `seed_builtins` and call it
in `resolve_and_typecheck_module` — imported modules previously got
a bare context, so resolving e.g. string.affine (pulled in by io's
`use`) failed with UndefinedVariable "len".
2. resolve.ml: call `Typecheck.register_builtins` in the imported-module
typecheck path (the manual check_decl fold skipped it, giving
"Unbound variable: len" at the typecheck stage).
3. typecheck.ml: `register_builtins` was missing eprint/eprintln
(resolver seeds them; typecheck did not).
Plus: `pub` on string.split/join; `use string::{ split, join };` in io.
Result: io.affine now passes resolution fully (ADR-011 cross-module
import works end to end). io's remaining typecheck failure is a
separate pre-existing register_builtins drift (file-I/O builtin family
+ read_line type), tracked separately. Full suite 233/233 green, zero
regression; stdlib 12/19 (unchanged count, io advanced resolve→tc).
Refs #1281 parent 44c0644 commit a45268d
4 files changed
Lines changed: 33 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| |||
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
91 | | - | |
| 89 | + | |
92 | 90 | | |
93 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
| |||
548 | 556 | | |
549 | 557 | | |
550 | 558 | | |
| 559 | + | |
551 | 560 | | |
552 | 561 | | |
553 | 562 | | |
| |||
559 | 568 | | |
560 | 569 | | |
561 | 570 | | |
562 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
563 | 575 | | |
| 576 | + | |
564 | 577 | | |
565 | 578 | | |
566 | 579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
| 1197 | + | |
| 1198 | + | |
1197 | 1199 | | |
1198 | 1200 | | |
1199 | 1201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
0 commit comments