2014-07-13 01:04:16 +02:00
|
|
|
//// [callSignaturesThatDifferOnlyByReturnType2.ts]
|
|
|
|
// 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> { }
|
|
|
|
|
|
|
|
var x: A;
|
|
|
|
// BUG 822524
|
|
|
|
var r = x.foo(1); // no error
|
|
|
|
var r2 = x.foo(''); // error
|
|
|
|
|
|
|
|
|
|
|
|
//// [callSignaturesThatDifferOnlyByReturnType2.js]
|
2014-08-19 19:43:13 +02:00
|
|
|
// 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.
|
2014-07-13 01:04:16 +02:00
|
|
|
var x;
|
2014-08-12 00:54:12 +02:00
|
|
|
// BUG 822524
|
2014-08-15 22:18:54 +02:00
|
|
|
var r = x.foo(1); // no error
|
|
|
|
var r2 = x.foo(''); // error
|