QuickInfo misleading with signatures from higher order function type inference #30373
Labels
Bug
A bug in TypeScript
Domain: Quick Info
e.g. hover text, tool-tips, and tooltips.
Domain: Type Display
Bugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info
Milestone
TypeScript Version: 3.4.0-dev.20190313
Search Terms:
Code
Expected behavior:
Propagated type parameters should be renamed if a different type with the same name is used in the constraint or initializer of any other propagated type parameter.
For example:
<T extends T1, T2 extends T1>
.Actual behavior:
Hovering over
listBox
displaysconst listBox: <T extends T1, T1 extends T1>(a: [T, T1]) => [T[], {value: T1;}]
Note the
T1 extends T1
andT extends T1
whereT1
refers to something completely different.This is not limited to renamed type parameters. Hovering over
listBox
in the following code displays circular type parameter constraints (<T extends V, V extends T>
) without any renaming going on:The text was updated successfully, but these errors were encountered: