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
typeNonFalsy<T>=Textendsfalse|0|""|null|undefined|0n
? never
: T;// Comment this outinterfaceArray<T>{filter(predicate: BooleanConstructor,thisArg?: any): NonFalsy<T>[];}constid=<T,>()=>(t: T)=>!!t;['foo','bar'].filter(id())// ^?
π Actual behavior
Nested function inference works (type parameter is string) without the additional overload, and fails (type parameter is unknown) with the overload (even though the added overload isn't the one in use).
π Expected behavior
Nested function inference should work regardless of whether an overload is added to .filter or not.
Additional information about the issue
Adding the overload is described in #50387 and made popular by ts-reset.
It's possible the overload order may matter in this instance, but difficult to test when the main overloads are coming from lib definitions.
The text was updated successfully, but these errors were encountered:
π Search Terms
"filter inference overload", "filter boolean"
π Version & Regression Information
β― Playground Link
https://tsplay.dev/wQbrvN
π» Code
π Actual behavior
Nested function inference works (type parameter is
string
) without the additional overload, and fails (type parameter isunknown
) with the overload (even though the added overload isn't the one in use).π Expected behavior
Nested function inference should work regardless of whether an overload is added to .filter or not.
Additional information about the issue
Adding the overload is described in #50387 and made popular by
ts-reset
.It's possible the overload order may matter in this instance, but difficult to test when the main overloads are coming from lib definitions.
The text was updated successfully, but these errors were encountered: