1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
=== tests/cases/compiler/mixingStaticAndInstanceOverloads.ts ===
class C1 {
>C1 : C1
// ERROR
foo1(n: number);
>foo1 : { (n: number): any; (s: string): any; }
>n : number
foo1(s: string);
>foo1 : { (n: number): any; (s: string): any; }
>s : string
static foo1(a) { }
>foo1 : (a: any) => void
>a : any
}
class C2 {
>C2 : C2
// ERROR
static foo2(n: number);
>foo2 : { (n: number): any; (s: string): any; }
>n : number
static foo2(s: string);
>foo2 : { (n: number): any; (s: string): any; }
>s : string
foo2(a) { }
>foo2 : (a: any) => void
>a : any
}
class C3 {
>C3 : C3
// ERROR
foo3(n: number);
>foo3 : { (n: number): any; (a: any): void; }
>n : number
static foo3(s: string);
>foo3 : (s: string) => any
>s : string
foo3(a) { }
>foo3 : { (n: number): any; (a: any): void; }
>a : any
}
class C4 {
>C4 : C4
// ERROR
static foo4(n: number);
>foo4 : { (n: number): any; (a: any): void; }
>n : number
foo4(s: string);
>foo4 : (s: string) => any
>s : string
static foo4(a) { }
>foo4 : { (n: number): any; (a: any): void; }
>a : any
}
class C5 {
>C5 : C5
// OK
foo5(n: number);
>foo5 : { (n: number): any; (s: string): any; }
>n : number
foo5(s: string);
>foo5 : { (n: number): any; (s: string): any; }
>s : string
foo5(a) { }
>foo5 : { (n: number): any; (s: string): any; }
>a : any
// OK
static foo5(n: number);
>foo5 : { (n: number): any; (s: string): any; }
>n : number
static foo5(s: string);
>foo5 : { (n: number): any; (s: string): any; }
>s : string
static foo5(a) { }
>foo5 : { (n: number): any; (s: string): any; }
>a : any
}
|