Skip to content

WASM inference: _infer_vera_type missing IndexExpr and IfExpr #314

@aallan

Description

@aallan

Bug

_infer_vera_type in vera/wasm/inference.py has no cases for IndexExpr or IfExpr, returning None. This causes array_append(arr, arr2[i]) to fail to compile because the element type of the indexed expression cannot be inferred.

Impact

Any use of array_append where the second argument is an array index expression (e.g. @Array<Int>.0[@Int.0]) fails with E602 (unsupported expressions). Similarly, using an if-else result as an argument to type-inferring builtins fails.

Fix

Added IndexExpr_infer_index_element_type and IfExpr → recursive inference on then branch. 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