diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2026-08-02 18:10:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-02 18:10:24 +0200 |
| commit | b6a6cefd5bd8e2e488b03024c18de3cd576d3046 (patch) | |
| tree | bda5240a18296d258ffa5a142a1f6c9e7bdc0627 /crates/cli/src/output.rs | |
| parent | d848efecb9678a3b083eb363a1c8508b812255c0 (diff) | |
feat: typed function references (#49)
Signed-off-by: Henry <mail@henrygressmann.de>
---------
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/cli/src/output.rs')
| -rw-r--r-- | crates/cli/src/output.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/cli/src/output.rs b/crates/cli/src/output.rs index bf568ed..40a271e 100644 --- a/crates/cli/src/output.rs +++ b/crates/cli/src/output.rs @@ -30,8 +30,9 @@ pub fn format_wasm_type(ty: WasmType) -> &'static str { WasmType::F32 => "f32", WasmType::F64 => "f64", WasmType::V128 => "v128", - WasmType::RefFunc => "funcref", - WasmType::RefExtern => "externref", + WasmType::Ref(ty) if ty.is_func() => "funcref", + WasmType::Ref(ty) if ty.is_extern() => "externref", + WasmType::Ref(_) => "ref", } } @@ -62,7 +63,7 @@ pub fn format_table_type(ty: &TableType) -> String { MemoryArch::I64 => "i64", }; let max = ty.size_max.map(|v| v.to_string()).unwrap_or_else(|| "unbounded".to_string()); - format!("table[{arch} {}] initial={} max={max}", format_wasm_type(ty.element_type), ty.size_initial) + format!("table[{arch} {}] initial={} max={max}", format_wasm_type(WasmType::Ref(ty.element_type)), ty.size_initial) } pub fn format_global_type(ty: &GlobalType) -> String { |
