TypeScript/tests/baselines/reference/overloadOnConstInheritance3.errors.txt
2014-09-11 16:11:08 -07:00

18 lines
937 B
Plaintext

==== tests/cases/compiler/overloadOnConstInheritance3.ts (3 errors) ====
interface Base {
addEventListener(x: string): any;
}
interface Deriver extends Base {
~~~~~~~
!!! error TS2429: Interface 'Deriver' incorrectly extends interface 'Base':
!!! error TS2429: Types of property 'addEventListener' are incompatible:
!!! error TS2429: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'.
// shouldn't need to redeclare the string overload
addEventListener(x: 'bar'): string;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
addEventListener(x: 'foo'): string;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
}