File: typeQueryOnClass.types

package info (click to toggle)
node-typescript 5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 497,488 kB
  • sloc: javascript: 2,107,274; makefile: 6; sh: 1
file content (130 lines) | stat: -rw-r--r-- 1,788 bytes parent folder | download
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//// [tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryOnClass.ts] ////

=== typeQueryOnClass.ts ===
class C<T> {
>C : C<T>

    constructor(x: number);
>x : number

    constructor(x: string);
>x : string

    constructor(public x) { }
>x : any

    static foo(x: number);
>foo : { (x: number): any; (x: {}): any; }
>x : number

    static foo(x: {});
>foo : { (x: number): any; (x: {}): any; }
>x : {}

    static foo(x) { }
>foo : { (x: number): any; (x: {}): any; }
>x : any

    static bar(x) { }
>bar : (x: any) => void
>x : any

    static sa = 1;
>sa : number
>1 : 1

    static sb = () => 1;
>sb : () => number
>() => 1 : () => number
>1 : 1

    static get sc() {
>sc : number

        return 1;
>1 : 1
    }
    static set sc(x) {
>sc : number
>x : number
    }

    static get sd() {
>sd : number

        return 1;
>1 : 1
    }

    baz(x): string { return ''; }
>baz : (x: any) => string
>x : any
>'' : ""

    ia = 1;
>ia : number
>1 : 1

    ib = () => this.ia;
>ib : () => number
>() => this.ia : () => number
>this.ia : number
>this : this
>ia : number

    get ic() {
>ic : number

        return 1;
>1 : 1
    }
    set ic(x) {
>ic : number
>x : number
    }

    get id() {
>id : number

        return 1;
>1 : 1
    }

}

var c: C<string>;
>c : C<string>

// BUG 820454
var r1: typeof C;
>r1 : typeof C
>C : typeof C

var r2: typeof c;
>r2 : C<string>
>c : C<string>

class D<T> {
>D : D<T>

    constructor(public y?) { }
>y : any

    x: T;
>x : T

    foo() { }
>foo : () => void
}

var d: D<string>;
>d : D<string>

var r3: typeof D;
>r3 : typeof D
>D : typeof D

var r4: typeof d;
>r4 : D<string>
>d : D<string>