Commit f2811ac
committed
Fix externref trait-object cast path for wasm-gc
Fixes moonbitlang/moonbit-docs#1123.
The wasm-gc backend was emitting invalid cast sequences when trait-object conversion involved #external values across supertrait chains.
This change adds a Pidentity lowering path in clam_of_core and tightens Pcast lowering to avoid redundant casts and preserve source/target type intent.
In wasm_of_clam_gc, Lcast now handles Ref_extern<->Ref_any with the dedicated conversion ops (Extern_convert_any / Any_convert_extern) instead of generic ref_cast where needed.1 parent 3979aac commit f2811ac
2 files changed
+31
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
253 | 263 | | |
254 | 264 | | |
255 | 265 | | |
256 | 266 | | |
257 | 267 | | |
258 | 268 | | |
| 269 | + | |
259 | 270 | | |
260 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
261 | 275 | | |
262 | 276 | | |
263 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| |||
574 | 580 | | |
575 | 581 | | |
576 | 582 | | |
577 | | - | |
578 | | - | |
579 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
580 | 593 | | |
581 | 594 | | |
582 | 595 | | |
| |||
0 commit comments