Repository navigation
TSLANG 211: leftovers of 193/194/205, own conversions and for...of literals, own past-end check - #1045
Open
ASDAlexander77 wants to merge 3 commits into
Open
TSLANG 211: leftovers of 193/194/205, own conversions and for...of literals, own past-end check#1045ASDAlexander77 wants to merge 3 commits into
ASDAlexander77 wants to merge 3 commits into
Conversation
… literal type; union field missing on a shape is an error; in for shape unions; X & any; generic intersections Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…red class overload error, own past-end check, tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eclared overload error (tsc sweep regressions); partial union field read from the member held; any only when written Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Leftovers of TSLANG 193, 194 and 205, plus old "still open" notes that a triage re-ran against current main (TSLANG 211).
Fixed
const(export const KA = "a"; run({ kind: KA, method(a) {...} })) failed with "can't be stored". By the 09-13 ruling an exportedconstis stored as alet, but its type was widened tostringalong with that. It is never assigned, so it now keeps its string literal type, as in TypeScript.v.msgof{ valid } | { valid; msg }was read as if the value were the first member that hasmsg, which reads past the end of a smaller member. It is now read from the member the value holds, and gives the type's empty value for a member that lacks the field."msg" in vnow works on a union of object shapes (it was "only a union of interfaces is") and narrows the same way as for interfaces.{ x: string } & anyisanywhenanyis written in the intersection (never & anystaysnever;X & unknownisX). It used to benever. The tsc test that looped with the first attempt now stops at once, on an unrelated error.-mm=own, converting a variable that holds a string to another object type (const u = { n: 1, name: "x" + i }; const p: { n: number; name: string } = u) failed with "a value that borrows a field cannot be stored". The new object takes a copy of each string, is built in a slot, and goes into a local of its own. That only happens when every other block-holding field is new or constant; otherwise it stays a borrow, as before. 2M conversions stay at about 6 MB.-mm=own.for (const o of [new A(), new B()])failed with "moved only into a local". The literal now goes into a local of its own.-mm=own. An element stored past the end through a local over a parameter's array (let src = order; src[n] = v), or through aSharedpayload, was written past the end of its block, corrupting the heap. It now throws aRangeError(or hits an assert without the default library). This is not JavaScript's behaviour, which grows the array: growing through such a local needs a new own rule (apushthrough it is refused too).Tried and taken back out (each failed tsc-clean tests in the sweep; recorded in TSLANG_ISSUES 211):
Record<string, T>as a dictionary: a constraintT extends Record<string, X>no longer accepted object literals.{ x: string } & TuntilTis known: inference failed elsewhere.switch (true)clauses, truthy discriminants) that tsc-clean code relies on.Not done: listed in TSLANG_ISSUES 211, with repro files from the triage. This includes own
<{ code: number }>aof an s32any, 132, theObject.*gaps, 191, and the own loop and closure shapes.Checks
🤖 Generated with Claude Code