Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make objects like (1,2,3) have the correct length annotation
  • Loading branch information
sorear committed Nov 6, 2011
1 parent 87e76e7 commit f7293ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/runtime/Runtime/Ops/P6list.lua
Expand Up @@ -5,7 +5,14 @@ function Ops.lllist_get_at_pos(TC, LLList, Index)
end

function Ops.lllist_bind_at_pos(TC, LLList, IndexObj, Value)
LLList.Storage[Ops.unbox_int(TC, IndexObj) + 1] = Value;
local ix = Ops.unbox_int(TC, IndexObj) + 1;
if ix == LLList.Storage.Count + 1 then
-- the compiler likes to generate code to bind outside the range of
-- lists hoping to extend.. <double sigh>
LLList.Storage:Push(Value);
else
LLList.Storage[ix] = Value;
end
return Value;
end

Expand Down

0 comments on commit f7293ef

Please sign in to comment.