You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeTail<Textendsany[]>=((...t: T)=>void)extends(h: any,
...rest: infer R)=>void
? R
: never;
🙁 Actual behavior
Wrapped () gets removed on hovering from the declared conditional inferring type.
Because of this the hovered type shown is not the same as the declared type and they are not interchangeable and can cause bugs.
Without parenthesis, the TS parses it as a Type which returns a Function and the return type of the function is that conditional "void extends ..." which is not what was declared.
Example -
🙂 Expected behavior
() should be preserved and shown while hovering so to prevent the errors that can arise because of missing () in the conditional inferring types