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
interfaceTruthyPredicate{<T>(o: T): o is T&{};}interfaceEmptyInterface{}typeConstructorSignagure={new(...args: any[]): any;};declareconstarr: (string|undefined)[];declareconstpredicate1: TruthyPredicate;constfiltered1=arr.filter(predicate1);// works string[]declareconstpredicate2: TruthyPredicate&EmptyInterface;constfiltered2=arr.filter(predicate2);// doesn't workdeclareconstpredicate3: TruthyPredicate&{}/* Empty object type instead of interface */;constfiltered3=arr.filter(predicate3);// works string[]declareconstpredicate4: TruthyPredicate&ConstructorSignagure;constfiltered4=arr.filter(predicate4);// doesn't work
π Search Terms
predicate intersection
π Version & Regression Information
latest version v5.6.2
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.6.2#code/JYOwLgpgTgZghgYwgAgCpQK5gBYE8AKUEAJsAnJMgN4CwAUMo8gDyoB8AFAPYBcaAlHy7JgAZzTIAZNQC+Abnoz69UJFiIUAUQC2ABzC4AkuGjwk1RcroHdKAMJcQosJgRguUAMrAA5iDg+GETIALwWDEwgEADuyBwAdIlwUD6ifHAguADaALqCyBm4CnTyVsQQCAA2ySgIjs4FUFB8HM5QoD7IAD7IGCDlMKAk-LnF9OVVNch1TmDIukSk5JAAjHzoWHiEJGQUEMUzDYOVaiQroY1Q8cdqHAs7yxAr-HLIAPRvyNEeANbibR1clZxhVqsFDnN7ks9gAmdaYHAERa7SjSHT6IwmdRIA71OY3aAkGEXZJXAlQO7Ix4wl7vT7ELgQUQgADkc2+UB+wLoEzBtTx8ypewAzPDNkiHnspLJcbNkOSSMKSU1rsATtBKZLIMLaR8vr9-i5ATlubyphDBVqIAAWMWI7bQ1HIByzVzuLy+fyBIiyo5q07Ea3Ksn+jVQlE23X0xnMtn6zn0IA
π» Code
π Actual behavior
Predicate stops working
π Expected behavior
Predicate works
Additional information about the issue
I tried other scenarios
The text was updated successfully, but these errors were encountered: