Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 9, 2025

This PR documents the investigation of microsoft/TypeScript#62549 and confirms that the change has already been successfully ported to the Go codebase.

Background

PR #62549 "Consistently resolve to the errorType on arguments with error" modifies the TypeScript checker to pass ignoreArrowFunctions: true when checking if arguments is used in a property initializer or class static block. This ensures that arguments inside arrow functions within property initializers resolves to errorType (displaying as type any), making the behavior consistent.

Interesting Discovery

The change from PR #62549 was actually ported to the Go codebase before it was merged into TypeScript!

Timeline

As noted in the PR #1828 review:

"this has some seemingly unwanted diffs but I think this is basically desired and I opened a PR to Strada to close this gap: microsoft/TypeScript#62549"

Current State

The equivalent change is already present in the Go codebase at internal/checker/checker.go:10599:

if c.isInPropertyInitializerOrClassStaticBlock(node, true /*ignoreArrowFunctions*/) {
    c.error(node, diagnostics.X_arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks)
    return c.errorType
}

Verification

  • ✅ All tests pass
  • ✅ The specific test argumentsUsedInClassFieldInitializerOrStaticInitializationBlock passes
  • ✅ The testdata baseline shows the correct behavior (returning any type instead of IArguments for arguments in arrow functions within property initializers)

Conclusion

No code changes are needed. This PR adds documentation (PR_62549_PORT_STATUS.md) to record that the change has been successfully ported and is functioning correctly. In fact, the Go port led the way, and TypeScript followed!

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/microsoft/typescript/pulls/62549
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Port microsoft/TypeScript/pull/62549

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 changes from microsoft/TypeScript#62549 Document that PR #62549 has already been ported Oct 9, 2025
@Copilot Copilot AI requested a review from RyanCavanaugh October 9, 2025 17:13
Copilot finished work on behalf of RyanCavanaugh October 9, 2025 17:13
@RyanCavanaugh
Copy link
Member

Good job!

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