Skip to content

WASM inference: _infer_fncall_vera_type missing apply_fn #315

@aallan

Description

@aallan

Bug

_infer_fncall_vera_type in vera/wasm/inference.py has no case for apply_fn(closure, ...). When the result of apply_fn is passed to array_append (e.g. array_append(acc, apply_fn(fn, elem))), the element type cannot be inferred, causing the append to fail.

Impact

Any use of apply_fn whose result is passed to a built-in that needs Vera type inference (like array_append) fails with E602.

Fix

Added apply_fn case that resolves the closure's return type via type alias lookup and type parameter substitution. Fixed in the feat/array-operations branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions