Closed
Description
I wonder if this is a bug. But at least this is a discrepancy between specification and implementation.
It appears in TS 1.03 function overloading cannot differ only by return type, but in TS1.1 this restriction was lifted.
function a(): number
function a(): string
function a(): any { return null as any}
SO question: http://stackoverflow.com/questions/25022331/overloads-cannot-differ-only-by-return-type
Spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#1212-ambient-function-declarations
This should also impact call signatures in intersection types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment