Skip to content

Add failing test for reverse mapped this leak (#62779) - #62801

Closed
Gnana Priyanka (priyankagnana) wants to merge 2 commits into
microsoft:mainfrom
priyankagnana:failing-test-62779
Closed

Add failing test for reverse mapped this leak (#62779)#62801
Gnana Priyanka (priyankagnana) wants to merge 2 commits into
microsoft:mainfrom
priyankagnana:failing-test-62779

Conversation

@priyankagnana

@priyankagnana Gnana Priyanka (priyankagnana) commented Nov 24, 2025

Copy link
Copy Markdown

Related to #62779
This PR adds a failing compiler test for issue #62779.

Summary
The test demonstrates that this inside a reverse-mapped type leaks a generic key type and causes incorrect inference (T[string]) instead of the concrete property return type.

Files added

  • tests/cases/compiler/reverseMappedThisLeak.ts
  • tests/baselines/reference/reverseMappedThisLeak.errors.txt
  • tests/baselines/reference/reverseMappedThisLeak.js
  • tests/baselines/reference/reverseMappedThisLeak.types
  • tests/baselines/reference/reverseMappedThisLeak.symbols

Reproduction
The test is the minimal reproduction from the issue and is runnable with the existing test harness.

Notes

  • This PR does not include a compiler fix — only a failing test + baselines to help maintainers reproduce and track the bug.
  • To reproduce locally:
    • npm test -- tests/cases/compiler/reverseMappedThisLeak.ts (should pass once baselines are in reference/)
    • npm test -- --generateBaseline was used earlier to create these baselines.

(Please let me know if maintainers want a smaller repro or further variations.)

@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 24, 2025
@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 24, 2025
@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@jakebailey

Copy link
Copy Markdown
Member

We don't need a PR for the failing test alone. The issue already has it, so we should add this when the issue is fixed.

@github-project-automation github-project-automation Bot moved this from Not started to Done in PR Backlog Dec 4, 2025
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Jun 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants