Skip to content

collections.vera WAT compilation fails: i32_pair in closure parameter #359

@aallan

Description

@aallan

Running vera run examples/collections.vera fails with a WAT compilation error:

WAT compilation failed: unexpected token
--> <anon>:936:61
936 | (func $anon_0 (param $env i32) (param $p0 i32) (param $p1 i32_pair) (result i32)

The codegen emits i32_pair as a raw WASM type for a closure parameter, but i32_pair is an internal Vera type representation — WASM only supports i32, i64, f32, f64. The pair type should be expanded to two separate i32 parameters.

The example passes vera check and vera verify (CI validates these), but fails at vera run.

Reproduction

vera run examples/collections.vera

Affects: Any closure that takes a pair-ABI argument (String, Array) as a parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcodegenCode generation backend

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions