Skip to content

Commit 5018e78

Browse files
fix(wasm): resolve E0308 — bet-wasm + whole Rust workspace build green (#64)
## Fix `bet-wasm` E0308 — whole Rust workspace now builds green `bet-wasm` was the one Rust crate that didn't compile (long flagged "paused"). The default-return scaffold's `match ret_ty` had **incompatible arm types**: the `I32` arm was a statement block (`()`), while `I64`/`F32`/`F64` were bare `func.instruction(...)` expressions (which return `&mut Function`). The match is purely side-effecting (it emits a default-return instruction; its value is unused), so all arms are now `()` statement blocks. ### Verified (locally, via cargo) - `cargo test -p bet-wasm` → **8 passed** - `cargo build --workspace` → **exit 0** — every Rust crate now compiles (bet-syntax, bet-parse, bet-core, bet-check, bet-eval, bet-codegen, bet-wasm). README status refreshed: WASM backend **paused → builds (scaffolding)** — it compiles and emits default-return stubs; real AST→WASM lowering is still pending (that's separate work, not claimed here). ### Scope This is the **build-unblock only**. The other half of the "finish the Rust pipeline" item — raising `bet-eval`/`bet-codegen` toward parity with the authoritative Racket interpreter — remains follow-on work. https://claude.ai/code/session_01QGi8GND5yNWgDyfReVEPYs --- _Generated by [Claude Code](https://claude.ai/code/session_01QGi8GND5yNWgDyfReVEPYs)_
2 parents f925b52 + ce5e755 commit 5018e78

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ for the mechanised fragment.
9696
* `compiler/bet-core/` — core type definitions (incl. `Echo T`, `EchoR T`)
9797
* `compiler/bet-check/` — Hindley-Milner type checker + unifier (27 tests pass)
9898
* `compiler/bet-parse/` — LALRPOP-based surface parser
99-
* `compiler/bet-wasm/` — WASM backend (**paused**, pre-existing build issue)
99+
* `compiler/bet-wasm/` — WASM backend (builds; scaffolding — emits default-return stubs pending AST lowering)
100100

101101
Rust is the compiler tooling layer. Core semantics remain in Racket.
102102

@@ -453,7 +453,7 @@ BetLang is built on three principles:
453453
| VS Code extension | 🟡 In progress | AffineScript source (replaces ReScript)
454454
| Web Playground (ui/) | ✅ Available | Quantum-inspired features
455455
| FFI (Zig) | 🟡 Experimental | playground/ffi/zig/
456-
| WASM backend | ⏸️ Paused | Pre-existing build issue in bet-wasm
456+
| WASM backend | 🟡 Builds (scaffolding) | E0308 fixed; emits default-return stubs pending AST lowering
457457
|===
458458

459459
---

0 commit comments

Comments
 (0)