Repository navigation
Read T[keyof T] as unknown for T bound to an unknown-valued record - #1485
Merged
ctate merged 1 commit intoOct 20, 2026
Merged
Conversation
Inside a generic body Object.entries(t) over T extends Record<string, unknown> types its values 'keyof T extends never ? unknown : T[keyof T]'. An instance whose T maps to the checked-dynamic value now reads both branches as unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Stacked on #1433 (opt/trace-reachable-blockers).
Inside a generic body,
Object.entries(t)overT extends Record<string, unknown>types its elements as[string, keyof T extends never ? unknown : T[keyof T]]. #1433 resolves that conditional, andT[keyof T], against a bound record. An instance whoseTisRecord<string, unknown>, which maps to the checked-dynamic value, still failed with SC2009. NowT[keyof T]over such aTreads as unknown. The conditional also reads as unknown, because both of its branches agree.Evidence
6468-generic-unknown-record-entries.tsis byte-identical to Node in both lanes and fails on the base branch.pnpm lintandpnpm format:checkare clean.pnpm test:ts7 --baselines-onlypasses.🤖 Generated with Claude Code