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
fix(vectorization): address PR review and tighten compile-time checks π
OpAssignment with vec dispatch
β’ Use candidate_return so `a += (3, 4)` on a `Tuple<Int, Int>` lvalue
widens against the tuple return type instead of the underlying
scalar's `Int`. Without this, annotated tuple lvalues errored and
unannotated ones silently widened to Any.
β’ Vec op= now emits SET_VAR (not Pop): dispatch_vec_call allocates a
fresh result tuple, so the lvalue must be re-stored. The inner Rcs
inside that tuple are still the same ones the element calls mutated,
so aliasing semantics match scalar op= for List/HashMap stdlib ops.
New test 011_vector_op_assign_aliasing.ndc pins the behaviour.
β’ Only emit function_not_found when BOTH `op` and `op=` are
Binding::None β previously a missing bare `-` would error even when
`-=` handled the call (e.g. `Map -= Map` via difference_assign).
Compile-time function_not_found for incompat call sites
β’ resolve_function_binding now filters the all_by_name fallback by
parameter compatibility. Concrete-Function slots whose params don't
accept the call's arg types get dropped; Any-typed and variadic
slots stay (we can't tell statically). When the filtered list is
empty, Binding::None is returned and the analyser emits
function_not_found at compile time instead of letting the call
fail at runtime with a less-specific error. Regression test
bug0022_incompat_dynamic_misinferred.ndc covers the case where the
old behaviour silently inferred a misleading concrete return type.
Empty-map value-type inference
β’ `%{}` now infers `Map<Any, Any>` (was `Map<Any, ()>` which was too
narrow for almost any operation).
β’ `%{:0}` now folds the default's type into value_type, so the map
infers `Map<Any, Int>` instead of `Map<Any, ()>` β needed so that
`map[k] += 1` on a defaulted map type-checks.
Runtime / VM
β’ `Callable::Vec` carries axis_len so dispatch_vec_call doesn't
re-walk the args to find it.
β’ dispatch_vec_call uses split_off instead of stack-slice + truncate.
Tidy
β’ analyser.rs has a single `impl Analyser` block again; free helpers
moved below.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments