Skip to content

v0.0.146

Choose a tag to compare

@aallan aallan released this 12 May 08:34
d22601e

Fixed

  • #655 Shape B — array indexing through a refinement-of-Array alias (e.g. type NonEmptyArray = { @Array<Int> | array_length(@Array<Int>.0) > 0 } plus fn head(@NonEmptyArray -> @Int) { @NonEmptyArray.0[0] }) now compiles cleanly and runs correctly. Pre-fix vera/wasm/inference.py::_alias_array_element only followed isinstance(target, ast.NamedType) chains when resolving an alias to its underlying Array<T>; if the alias target was a RefinementType (which the user's refinement syntax produces), the helper returned None. Downstream _infer_index_element_type then returned None for @NonEmptyArray.0[0], the head function got dropped via [E602] with "body contains unsupported expressions — skipped", and any call site referenced a non-existent $headunknown func: $head at WASM validation. Post-fix the alias-target lookup peels any RefinementType layers before checking for a NamedType base, so refinement-of-Array aliases resolve their element type the same as a bare Array<T>. Closes #655 (Shape A was closed in v0.0.145; Shape B is this fix). Allowlist in scripts/check_e602_clean.py shrinks from 6 to 5 entries.