Conversation
|
A bit more context on the fix. We previously would consider two type parameters identical if they were different type parameters but had identical constraints (but, oddly, wouldn't consider them assignable to each other). This of course isn't right, but it sort of worked when we were comparing constraints in generic signatures which was really the only time it would come up. However, we now sometimes need to compare type parameters for identity during union and intersection type inference (because of #5738) and we want different type parameters to actually be considered different, so we have to remove this logic. The effect is that we won't check whether type parameter constraints are identical when comparing generic signatures, as explained here. |
There was a problem hiding this comment.
could you remove the error comment
|
Could you also add a test for the case that type parameter constraints are not identical, but we don't check? It would be good to have as documentation in case do we go back and decide to start checking. |
|
👍 |
Fix union type parameter inference
Fix union type parameter inference Conflicts: src/compiler/checker.ts
Fixes #5861.