Skip to content

[TS] Preserve async and sync iterator semantics in for-await (#385) - #421

Merged
CaelmBleidd merged 3 commits into
neofrom
caelmbleidd/ts-385-for-await
Oct 10, 2026
Merged

CaelmBleidd merged 3 commits into
neofrom
caelmbleidd/ts-385-for-await

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

For-await lowering now selects Symbol.asyncIterator with a Symbol.iterator fallback, caches next with its receiver, validates protocol objects, and unwraps sync iterator values through Async-from-Sync await behavior. The iterable is snapshotted before getter side effects can reassign its binding. Runtime errors reuse the shared iterator helper, and focused tests cover rejected values and iterator closing.

Validation: fresh typecheck and focused frontend tests (22 passed) on the exact rewritten head. The complete semantic stack at original #425 also passed the frontend build and 622 tests. Rebase preserved the original production tree exactly. For #421 and later, the expected tree also carries the reviewed Kotlin for-await assertion corrections. Frontend/JSON/model correctness does not establish downstream USVM execution support.

Fixes #385

@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-373-rest-parameter-contract branch from fe89681 to 790f734 Compare October 7, 2026 21:41
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-385-for-await branch from 1471922 to a68ddcb Compare October 7, 2026 21:41
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-373-rest-parameter-contract branch from 790f734 to 9d6f52d Compare October 10, 2026 17:38
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