Commit ed4881a
committed
fix(module_loader): revert #138 imported-type carry — fixes Deno-ESM duplicate constructor
Making CI standalone let `build` run for the first time (it had been
startup_failing), which surfaced a latent regression from #138: flatten_imports
carried imported public TopType decls into prog_decls, but the non-Wasm
backends emit Option/Result constructors from a built-in runtime preamble, so
the prelude types' Some/None/Ok/Err got declared twice. Running the emitted
Deno-ESM module under node failed with
`SyntaxError: Identifier 'Some' has already been declared`
(tests/codegen-deno: http_fetch and others).
Revert the flatten_imports type-carrying. #138's load-bearing fix — Wasm
constructor tags via Codegen.gen_imports, which consumes the un-flattened
prog — is unaffected, and the flat backends keep emitting prelude constructors
via their preamble, so imported Option/Some/None/Ok/Err still lower on every
backend.
Verified: dune test 458 green (incl. the #138 Wasm test);
tools/run_codegen_deno_tests.sh all harnesses pass under node;
run_codegen_wasm_tests.sh + face-transformer tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lz7pRcec2Z3tVtaAhvB3M81 parent 8af6c5d commit ed4881a
1 file changed
Lines changed: 13 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
0 commit comments