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.
TypeScript Version: master (618da24)
Search Terms: type parameter same merging constraint
Code
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
areTypeParametersIdenticalfor another project. The problem is thatgetConstraintDeclarationalways looks at the first declaration.