File: callOverloads5.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (54 lines) | stat: -rw-r--r-- 978 bytes parent folder | download | duplicates (4)
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
=== tests/cases/compiler/callOverloads5.ts ===
function Foo():Foo; // error
>Foo : typeof Foo

function Foo(s:string):Foo; // error
>Foo : typeof Foo
>s : string

class Foo { // error
>Foo : Foo

	bar1(s:string);
>bar1 : { (s: string): any; (n: number): any; }
>s : string

	bar1(n:number);
>bar1 : { (s: string): any; (n: number): any; }
>n : number

    bar1(a:any) { /*WScript.Echo(a);*/ }
>bar1 : { (s: string): any; (n: number): any; }
>a : any

    constructor(x: any) {
>x : any

        // WScript.Echo("Constructor function has executed");
    }
}
//class Foo(s: String);

var f1 = new Foo("hey");
>f1 : Foo
>new Foo("hey") : Foo
>Foo : typeof Foo
>"hey" : "hey"


f1.bar1("a");
>f1.bar1("a") : any
>f1.bar1 : { (s: string): any; (n: number): any; }
>f1 : Foo
>bar1 : { (s: string): any; (n: number): any; }
>"a" : "a"

Foo();
>Foo() : Foo
>Foo : typeof Foo

Foo("s");
>Foo("s") : Foo
>Foo : typeof Foo
>"s" : "s"