Repository navigation
arguments.length counts the arguments given; generic arrows through generics; throw() at a yield* reaches the delegate (TSLANG 183) - #1020
Merged
Conversation
…enerics and rest-array function types; throw() at a yield* reaches the delegate (TSLANG 183) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eld* is not handed to the delegate there yet) 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.
TSLANG 183: items 114, 94 and 156.
arguments.lengthcounts the arguments the caller gave, not the parameters declared: an optional or defaulted parameter left out is not counted (mlirGenArguments), in loop conditions and for-of overargumentstoo.wrap(<T>(x: T) => x)) is instantiated foranyand inferred from that.(...args: A) => TinfersAas an array of the function's parameter type, and a function that takes its parameters one by one can be given as a rest-array function type: an adapter reads them from the array (fewerParametersThunk for named functions/arrows, functionValueAdapter for values read at run time). 94's example compiles and runs under gc and rc.yield*is handed to the delegate's throw(): it may catch and keep yielding, finish, or throw on through the generator's own try statements (mlirGenYieldStar, mlirGenGeneratorResumeChecks).Still open (in TSLANG_ISSUES.md 183):
h(1, undefined)counts 1; mixed-type callbacks for(...args: A) => T(needs tuple inference); -mm=own for the run-time adapter and for throw() at a yield*.Tests:
00arguments_length_given.ts(gc, rc, own),00generic_arrow_through_generic.ts(gc, rc),00generator_yield_star_throw.ts(gc, rc). Full local suite: only the 10 known local failures (stale I:\tslang default library, atomic-rc).🤖 Generated with Claude Code