You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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 $head → unknown 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.