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
Actual behavior: error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((arg1: number, arg2: false) => any) | ((arg1: number, arg2: true) => any)' has no compatible call signatures.
TypeScript Version: 3.1.0-dev.20180905
Search Terms: condtional types boolean
Code
Expected behavior: no compilation errors
Actual behavior: error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((arg1: number, arg2: false) => any) | ((arg1: number, arg2: true) => any)' has no compatible call signatures.
Playground Link:
https://www.typescriptlang.org/play/#src=type%20Action%3CT1%20%3D%20void%2C%20T2%20%3D%20void%3E%20%3D%0D%0A%20%20%20%20T1%20extends%20void%20%3F%20()%20%3D%3E%20any%20%3A%0D%0A%20%20%20%20T2%20extends%20void%20%3F%20(arg%3A%20T1)%20%3D%3E%20any%20%3A%0D%0A%20%20%20%20((arg1%3A%20T1%2C%20arg2%3A%20T2)%20%3D%3E%20any)%3B%0D%0A%0D%0Alet%20a%3A%20Action%3B%0D%0A%0D%0Aa()%3B%0D%0A%0D%0Alet%20b%3A%20Action%3Cnumber%3E%3B%0D%0A%0D%0Ab(1)%3B%0D%0A%0D%0Alet%20c%3A%20Action%3Cnumber%2C%20string%3E%3B%0D%0A%0D%0Ac(1%2C%20%22%22)%3B%0D%0A%0D%0Alet%20d%3A%20Action%3Cnumber%2C%20boolean%3E%3B%0D%0A%0D%0Ad(1%2C%20true)%3B%0D%0A
"Action" type should work similar to C# one: https://dotnetfiddle.net/HAtRbF
The text was updated successfully, but these errors were encountered: