Repository navigation
own: no growth through a handle's payload (#982 regression in the library); optional interface member calls lend the object - #983
Merged
Conversation
…ad (library TypedArray.set, workers) #982 made such a write a grows-only SetLengthOf, which own's passes read as a push into a Shared payload - a possible release of what callers borrow - and 8 DefaultLib tests stopped compiling under -mm=own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e object (g.return(v) then g.next()) The bound method value was wrapped in an optional, given out of the If that tests the member (a branch's block argument by then), tested and unwrapped for the call; own read that as moving the object into the method value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tor given to an Iterable as it is) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two -mm=own fixes the DefaultLib changes for TSLANG 153 needed.
A regression from #982:
a[i] = von an array reached through a handle's payload (s.value[i] = v) no longer grows the array under own. #982 made the write a grows-only SetLengthOf, and own's passes read that as a push into aSharedpayload, which may move elements another handle's borrow reads (spec 23.3). So the library'sTypedArray.setandMessageQueue.close(used by the workers) were taken for methods that release what their callers borrow. 8 DefaultLib tests stopped compiling under own:array_toLocaleStringmessage_queuetyped_array_clampedtyped_array_float16worker_echo,worker_errors,worker_objects,worker_terminateThe error was "a value that borrows 'this.elements' is used here after it may be released". The write is now as it was before #982. New test:
00array_write_shared.ts.Calling an optional function-typed interface member:
g.return(v)followed byg.next()was "'g' is used here after its value was moved" under own. The bound method value is wrapped in an optional, passed out of theIfthat tests the member (by then a branch's block argument), tested, and unwrapped for the call. All of that only calls it, so it now lends the object to the call, as a call of a non-optional member does (boundOnlyCalled). Storing the method value still moves the object, as before. The DefaultLib'sGeneratordeclaresreturn?andthrow?this way. They stay fields, not methods: a method member shifts the vtable, and aGeneratorcould then no longer be cast to anIterable. New test:00interface_optional_member_call.ts; alpha133 fails it.TSLANG 152 and 153 are updated.
Checked locally:
generator-next-value) built with this compiler: every release test passes under gc, rc, none and own, compiled and JIT.🤖 Generated with Claude Code