2015-03-05 03:15:55 +01:00
tests/cases/compiler/overloadingOnConstants2.ts(8,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type 'string' is not assignable to parameter of type '"bye"'.
2015-03-05 03:15:55 +01:00
tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
2014-09-12 22:35:07 +02:00
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/overloadingOnConstants2.ts (4 errors) ====
class C {
private x = 1;
}
class D extends C {}
class E {
private y = 1;
}
function foo(x: "hi", items: string[]): D;
2015-03-05 03:15:55 +01:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
2014-07-13 01:04:16 +02:00
function foo(x: "bye", items: string[]): E;
2015-03-05 03:15:55 +01:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
2014-07-13 01:04:16 +02:00
function foo(x: string, items: string[]): C {
return null;
}
var a: D = foo("hi", []); // D
var b: E = foo("bye", []); // E
var c = foo("um", []); // 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 '"bye"'.
2014-07-13 01:04:16 +02:00
//function bar(x: "hi", items: string[]): D;
function bar(x: "bye", items: string[]): E;
2015-03-05 03:15:55 +01:00
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
2014-07-13 01:04:16 +02:00
function bar(x: string, items: string[]): C;
function bar(x: string, items: string[]): C {
return null;
}
var d: D = bar("hi", []); // D
var e: E = bar("bye", []); // E
var f: C = bar("um", []); // C