Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 9, 2025

This PR verifies that TypeScript PR #60680 has already been ported to the Go codebase.

TypeScript PR #60680 Summary

The original TypeScript PR (microsoft/TypeScript#60680) marks inherited any-based index signatures so they can be elided in declaration emit. This prevents them from being mistaken for late-bound index signatures, which is important for partial/single-file compilation modes where extra any types from missing imports could spoil the emit.

Verification Results

All changes from the TypeScript PR are already present in the Go codebase:

  1. Cached index info: A anyBaseTypeIndexInfo field was added to the checker struct to cache the any-based index signature instead of creating it inline each time.

  2. Usage locations: The cached index info is used in:

    • Class inheritance when base type is any (internal/checker/checker.go:18408)
    • Constructor type resolution when base constructor is any (internal/checker/checker.go:19945)
  3. Emit filtering: The emit resolver skips anyBaseTypeIndexInfo during declaration emit to avoid including inherited any-based index signatures (internal/checker/emitresolver.go:1017-1019).

Testing

  • ✅ Code builds successfully
  • ✅ All tests pass, including the new test case declarationEmitClassInherritsAny.ts from the TypeScript PR
  • ✅ Full test suite passes without issues

The port was already included in the initial Go codebase (commit 9374294 from October 9, 2025), which postdates the TypeScript PR merge (December 4, 2024). No additional changes are required.

Original prompt

From the TypeScript repo, port PR#60680

Note

Custom agent used: Strada to Corsa Port Expert
A Go and TypeScript expert who can easily figure out how to port PRs from one language to another


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Port PR#60680 from TypeScript repository Verify TypeScript PR #60680 already ported: Mark inherited any-based index signatures Oct 9, 2025
@Copilot Copilot AI requested a review from RyanCavanaugh October 9, 2025 21:33
Copilot finished work on behalf of RyanCavanaugh October 9, 2025 21:33
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.

2 participants