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
{{ message }}
Repository navigation
An array inside a tuple literal built at run time cannot be changed (push unresolved; const has no storage) #486
error: Can't resolve property 'push' of type s32[]
The tuple's type is tuple<number, const_array<si32, 1>>: the inner literal keeps its constant-array type instead of being widened to s32[] (createTupleFromArrayLiteral takes each value's type as is).
Expected: 2.
2. A const of a run-time tuple has no storage: an array in it cannot be changed.
error: Can't get reference of the array, ensure const array is not used
Expected: 3. With let nt it prints 3 (since #484; on main the let form crashes, which was #479).
processConstRef gives a const storage for a constant array, an array, a constant tuple holding an array (#484), a record read from a literal slot that owns memory, and a few other cases. A tuple built by ts.CreateTuple with an array inside is not among them, so nt is folded to the SSA value, and push has no reference to work through.
Both shapes give the same errors on main (77d9a6a) and with #484.
Activity