Skip to content

Fixed anyFunctionType leak - #64131

Open
Mateusz Burzyński (Andarist) wants to merge 2 commits into
microsoft:mainfrom
Andarist:fix/any-function-type-leak-go
Open

Fixed anyFunctionType leak#64131
Mateusz Burzyński (Andarist) wants to merge 2 commits into
microsoft:mainfrom
Andarist:fix/any-function-type-leak-go

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

recreates #61980
fixes #61979

Copilot AI balanced review requested due to automatic review settings September 2, 2026 09:49
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 2, 2026
@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug labels Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two regression cases duplicate fn coverage instead of exercising the intended fn2 scenarios.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes cached anyFunctionType leakage during contextual return-type computation.

Changes:

  • Recomputes return types without CheckModeSkipContextSensitive.
  • Adds compiler regression cases and diagnostic/type/symbol baselines.
File summaries
File Description
tsc/internal/checker/checker.go Prevents context-sensitive return types from leaking anyFunctionType.
tsc/testdata/tests/cases/compiler/contextualTypingGenericFunction2.ts Adds regression scenarios.
tsc/testdata/baselines/reference/compiler/contextualTypingGenericFunction2.errors.txt Records expected diagnostics.
tsc/testdata/baselines/reference/compiler/contextualTypingGenericFunction2.types Records inferred types.
tsc/testdata/baselines/reference/compiler/contextualTypingGenericFunction2.symbols Records symbol information.
Review details

Suppressed comments (1)

tsc/testdata/tests/cases/compiler/contextualTypingGenericFunction2.ts:57

  • This calls fn again and duplicates result3, leaving the corresponding inferred incompatible-return scenario untested for fn2. Change this call to fn2 and regenerate the baselines.
export const result6 = fn({
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tsc/testdata/tests/cases/compiler/contextualTypingGenericFunction2.ts Outdated
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.

Missing errors in generic functions in context-sensitive arguments

2 participants