Commit e1c1591
fix(effects): pin v1 effect-row registry + reject unknown names (#196)
Root cause of #59: lower_effect_expr accepted ANY string as an effect
(silent ESingleton name), so every contributor invented their own and
migrated /{IO} code did not unify with stdlib /io.
PR-1 (additive + aliases, per owner decision):
- effect.ml: canonical v1 registry — IO/Async/Partial/Throws/Mut,
reserved Random/Time/Net, legacy aliases io->IO/state->Mut/exn->Throws.
- typecheck: declared_effects on context (populated by
register_effect_decl); lower_effect_expr canonicalizes via the
registry and rejects names that are neither v1/reserved/alias nor a
user-declared — new UnknownEffect type_error with an
actionable message, raised via Effect_validation_error and caught at
the check_program boundary.
- stdlib/effects.affine untouched (legacy names still compile via
aliases — verified).
Gate: dune build clean; dune test --force 253/253, zero regression
(incl. AOT effects smoke). Verified: /IO /Async accepted, /io
canonicalizes, /Zonk rejected.
Follow-up (tracked, not in scope): braced /{IO} return-position row
syntax from the migration-stance doc is a separate grammar item.
Refs #59
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5605688 commit e1c1591
3 files changed
Lines changed: 80 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
| |||
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
160 | 179 | | |
161 | 180 | | |
162 | 181 | | |
| |||
186 | 205 | | |
187 | 206 | | |
188 | 207 | | |
| 208 | + | |
189 | 209 | | |
190 | 210 | | |
191 | 211 | | |
| |||
418 | 438 | | |
419 | 439 | | |
420 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
421 | 453 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
| 454 | + | |
| 455 | + | |
429 | 456 | | |
430 | 457 | | |
431 | 458 | | |
| |||
1565 | 1592 | | |
1566 | 1593 | | |
1567 | 1594 | | |
| 1595 | + | |
1568 | 1596 | | |
1569 | 1597 | | |
1570 | 1598 | | |
| |||
1671 | 1699 | | |
1672 | 1700 | | |
1673 | 1701 | | |
| 1702 | + | |
1674 | 1703 | | |
1675 | 1704 | | |
1676 | 1705 | | |
| |||
1717 | 1746 | | |
1718 | 1747 | | |
1719 | 1748 | | |
| 1749 | + | |
0 commit comments