Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for skipping type parameter constraints when merging interfaces is order dependent #23909

Closed
mattmccutchen opened this issue May 4, 2018 · 1 comment

Comments

@mattmccutchen
Copy link
Contributor

TypeScript Version: master (618da24)

Search Terms: type parameter same merging constraint

Code

// Error: "All declarations of 'A' must have identical type parameters."
interface A<T> { }
interface A<T extends string> { }

// No error
interface B<T extends string> { }
interface B<T> { }

Expected behavior: Same for A and B.

Actual behavior: Different behavior for A and B as indicated.

Playground Link: link

Related Issues: #20018

I noticed this while trying to understand the code of areTypeParametersIdentical for another project. The problem is that getConstraintDeclaration always looks at the first declaration.

@mattmccutchen
Copy link
Contributor Author

Now I read #20883 and it sounds like the order dependence was an intentional decision made late in the process and not documented in the original issue.

@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant