Commit 4be991e
authored
fix: bump deno_graph to 0.108.2 for wasm multi-value return types (#34070)
Bumps `deno_graph` from `=0.108.1` to `=0.108.2`.
Without this fix, importing a WebAssembly function whose signature has
multiple return values (e.g. `(result i32 i32)`) generates a TypeScript
declaration whose return type collapses to a single `number` instead of the expected tuple
`[number, number]`, so `deno check` reports an incorrect type.
Reproduction from the upstream issue:
```sh
mkdir /tmp/wasm-multi-value && cd /tmp/wasm-multi-value
deno run --allow-read --allow-write --allow-env - <<'JS'
import wabtMod from "npm:wabt@1.0.36";
const wabt = await wabtMod();
const wat = `(module
(func $add_and_sub (param $a i32) (param $b i32) (result i32 i32)
local.get $a local.get $b i32.add
local.get $a local.get $b i32.sub)
(export "add_and_sub" (func $add_and_sub)))`;
const mod = wabt.parseWat("t.wat", wat, { multi_value: true });
await Deno.writeFile("test.wasm", mod.toBinary({}).buffer);
JS
cat > test.ts <<'TS'
import { add_and_sub } from "./test.wasm";
const r: "expected-tuple" = add_and_sub(1, 2);
TS
./target/debug/deno check test.ts
```
With this PR, the inferred return type is now `[number, number]` rather
than `number`.
Fixes #34065
---------
Co-authored-by: lunadogbot <lunadogbot@users.noreply.github.com>1 parent f7de8c5 commit 4be991e
6 files changed
Lines changed: 19 additions & 3 deletions
File tree
- tests/specs/check/wasm_multi_value
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Binary file not shown.
0 commit comments