TypeScript-Handbook icon indicating copy to clipboard operation
TypeScript-Handbook copied to clipboard

Overload signatures and "function implementation"

Open gombosg opened this issue 5 years ago • 0 comments

This information that I found in this blog is missing in the handbook:

It is extremely important to keep in mind that the concrete function implementation must have an interface that matches the lowest common denominator of all of the overload signatures.

I'd like to add this to the Handbook, since it led to lots of unnecessary error debugging. The example is working, but it's not detailed why.

The error is "Overload signature is not compatible with function implementation." - where it's not trivial that the last function line (plus the function body) is considered "implementation".

gombosg avatar Feb 12 '19 19:02 gombosg