43 lines
630 B
Text
43 lines
630 B
Text
|
=== tests/cases/compiler/overload2.ts ===
|
||
|
enum A { }
|
||
|
>A : A
|
||
|
|
||
|
enum B { }
|
||
|
>B : B
|
||
|
|
||
|
function foo(a: A);
|
||
|
>foo : { (a: A): any; (b: B): any; }
|
||
|
>a : A
|
||
|
>A : A
|
||
|
|
||
|
function foo(b: B);
|
||
|
>foo : { (a: A): any; (b: B): any; }
|
||
|
>b : B
|
||
|
>B : B
|
||
|
|
||
|
// should be ok
|
||
|
function foo(x: number) {
|
||
|
>foo : { (a: A): any; (b: B): any; }
|
||
|
>x : number
|
||
|
}
|
||
|
|
||
|
class C { }
|
||
|
>C : C
|
||
|
|
||
|
function foo1(a: A);
|
||
|
>foo1 : { (a: A): any; (c: C): any; }
|
||
|
>a : A
|
||
|
>A : A
|
||
|
|
||
|
function foo1(c: C);
|
||
|
>foo1 : { (a: A): any; (c: C): any; }
|
||
|
>c : C
|
||
|
>C : C
|
||
|
|
||
|
// should be ok
|
||
|
function foo1(x: number) {
|
||
|
>foo1 : { (a: A): any; (c: C): any; }
|
||
|
>x : number
|
||
|
}
|
||
|
|