Skip to content

Type parameters are renamed in declarationsΒ #55653

Closed
@dragomirtitian

Description

@dragomirtitian

πŸ”Ž Search Terms

type parameters declaration rename

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ

⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.2.2#code/MYGwhgzhAECC0G9oF8CwAoAbmATtARtALzQA8sANAHwAUAHgFxwCUxV0dQA

πŸ’» Code

class A { }
var b = <A,>(x: A) => x

πŸ™ Actual behavior

Declaration file type for b is declare var b: <A_1>(x: A_1) => A_1;

πŸ™‚ Expected behavior

Declaration file type for b should be declare var b: <A>(x: A) => A; as written in source code. There is no reason to rename the type parameter

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issuePossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions