Skip to content

arguments.length counts the arguments given; generic arrows through generics; throw() at a yield* reaches the delegate (TSLANG 183) - #1020

Merged
ASDAlexander77 merged 2 commits into
mainfrom
tslang-183
Nov 24, 2026
Merged

ASDAlexander77 merged 2 commits into
mainfrom
tslang-183

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

TSLANG 183: items 114, 94 and 156.

  • 114 arguments.length counts 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 over arguments too.
  • 94 A generic arrow given to a parameter typed by a type parameter (wrap(<T>(x: T) => x)) is instantiated for any and inferred from that. (...args: A) => T infers A as 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.
  • 156 throw() of a generator paused in a 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

…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>
@ASDAlexander77
ASDAlexander77 merged commit 204a3ba into main Nov 24, 2026
8 checks passed
@ASDAlexander77
ASDAlexander77 deleted the tslang-183 branch November 24, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant