Skip to content

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jul 6, 2025

fixes #61728

@Copilot Copilot AI review requested due to automatic review settings July 6, 2025 12:12
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jul 6, 2025
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug labels Jul 6, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that index types on non-generic substitution types are resolved immediately (instead of deferred), addressing #61728.

  • Added two new compiler tests to verify index lookups on non-generic substitution types.
  • Modified getIndexType in checker.ts to bypass deferral when both baseType and constraint are non-generic.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

File Description
tests/cases/compiler/substitutionTypeNonGenericIndexType1.ts Adds a test for boolean conditional index resolution on non-generic substitution types.
tests/cases/compiler/substitutionTypeNonGenericIndexType2.ts Adds a test for infer-based index resolution on non-generic substitution types.
src/compiler/checker.ts Updates getIndexType to immediately compute index types for non-generic substitutions.
Comments suppressed due to low confidence (3)

tests/cases/compiler/substitutionTypeNonGenericIndexType2.ts:1

  • [nitpick] Consider adding a reference to GitHub issue #61728 at the top of this test for consistency with related test files.
// @strict: true

tests/cases/compiler/substitutionTypeNonGenericIndexType2.ts:14

  • [nitpick] Consider adding additional test cases where either the baseType or the constraint is generic to ensure this new index type logic covers mixed generic scenarios.
const test: Test["rejectClose"] = "rejectClose";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Poor quick info due to erroneously deferring keyof T since #51621
2 participants