2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/overload2.ts ===
|
|
|
|
enum A { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>A : A, Symbol(A, Decl(overload2.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
enum B { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>B : B, Symbol(B, Decl(overload2.ts, 0, 10))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo(a: A);
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (a: A): any; (b: B): any; }, Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19))
|
|
|
|
>a : A, Symbol(a, Decl(overload2.ts, 3, 13))
|
|
|
|
>A : A, Symbol(A, Decl(overload2.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo(b: B);
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (a: A): any; (b: B): any; }, Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19))
|
|
|
|
>b : B, Symbol(b, Decl(overload2.ts, 4, 13))
|
|
|
|
>B : B, Symbol(B, Decl(overload2.ts, 0, 10))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// should be ok
|
|
|
|
function foo(x: number) {
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (a: A): any; (b: B): any; }, Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19))
|
|
|
|
>x : number, Symbol(x, Decl(overload2.ts, 6, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class C { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>C : C, Symbol(C, Decl(overload2.ts, 7, 1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo1(a: A);
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo1 : { (a: A): any; (c: C): any; }, Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20))
|
|
|
|
>a : A, Symbol(a, Decl(overload2.ts, 10, 14))
|
|
|
|
>A : A, Symbol(A, Decl(overload2.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo1(c: C);
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo1 : { (a: A): any; (c: C): any; }, Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20))
|
|
|
|
>c : C, Symbol(c, Decl(overload2.ts, 11, 14))
|
|
|
|
>C : C, Symbol(C, Decl(overload2.ts, 7, 1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// should be ok
|
|
|
|
function foo1(x: number) {
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo1 : { (a: A): any; (c: C): any; }, Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20))
|
|
|
|
>x : number, Symbol(x, Decl(overload2.ts, 13, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|