2014-10-28 08:28:59 +01:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
2015-02-05 04:32:13 +01:00
Named property 'foo' of types 'I<number>' and 'I<string>' are not identical.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts (2 errors) ====
// Normally it is an error to have multiple overloads which differ only by return type in a single type declaration.
// Here the multiple overloads come from multiple bases.
interface I<T> {
foo(x: number): T;
}
interface A extends I<number>, I<string> { }
~
2014-10-28 08:28:59 +01:00
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
2015-02-05 04:32:13 +01:00
!!! error TS2320: Named property 'foo' of types 'I<number>' and 'I<string>' are not identical.
2014-07-13 01:04:16 +02:00
var x: A;
// BUG 822524
var r = x.foo(1); // no error
var r2 = x.foo(''); // error
2014-07-25 02:00:03 +02:00
~~
2014-09-12 00:19:57 +02:00
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
2014-07-13 01:04:16 +02:00