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
Expected behavior:
Should be able to call eat method since it matches one of the signature.
On playground link, line 27 should not be marked as error.
Funny thing is, removing line 2 (the un-matching function signature) makes tsc happy.
I've added line 32 to show typescript is happy as long as union type is not used
Actual behavior:
TSC marks it as error (Cannot invoke an expression whose type lacks a call signature.)
TypeScript Version: 3.6.0-dev.20190608
Search Terms: method overloading on union type
Code
please refer to the playground link below
Expected behavior:
Should be able to call eat method since it matches one of the signature.
On playground link, line 27 should not be marked as error.
Funny thing is, removing line 2 (the un-matching function signature) makes tsc happy.
I've added line 32 to show typescript is happy as long as union type is not used
Actual behavior:
TSC marks it as error (Cannot invoke an expression whose type lacks a call signature.)
Playground Link:
playground link
The text was updated successfully, but these errors were encountered: