S SearchRSS
< BackHome
Newest questions tagged typescript - Stack Overflow

Why does TypeScript fail to infer a callback parameter in a union when the discriminating property is an array literal?

I have a union where one member has a: number and the other has a?: never. The callback b has a different parameter type in each member. Which is correct. // Example 1: works type Test1 = { a: number; b: (a: true) => vo

View original source