File: assignParameterPropertyToPropertyDeclarationESNext.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (175 lines) | stat: -rw-r--r-- 2,941 bytes parent folder | download | duplicates (3)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
=== tests/cases/conformance/classes/propertyMemberDeclarations/assignParameterPropertyToPropertyDeclarationESNext.ts ===
class C {
>C : C

    qux = this.bar // should error
>qux : string
>this.bar : string
>this : this
>bar : string

    bar = this.foo // should error
>bar : string
>this.foo : string
>this : this
>foo : string

    quiz = this.bar // ok
>quiz : string
>this.bar : string
>this : this
>bar : string

    quench = this.m1() // ok
>quench : void
>this.m1() : void
>this.m1 : () => void
>this : this
>m1 : () => void

    quanch = this.m3() // should error
>quanch : void
>this.m3() : void
>this.m3 : () => void
>this : this
>m3 : () => void

    m1() {
>m1 : () => void

        this.foo // ok
>this.foo : string
>this : this
>foo : string
    }
    m3 = function() { }
>m3 : () => void
>function() { } : () => void

    constructor(public foo: string) {}
>foo : string

    quim = this.baz // should error
>quim : string
>this.baz : string
>this : this
>baz : string

    baz = this.foo; // should error
>baz : string
>this.foo : string
>this : this
>foo : string

    quid = this.baz // ok
>quid : string
>this.baz : string
>this : this
>baz : string

    m2() {
>m2 : () => void

        this.foo // ok
>this.foo : string
>this : this
>foo : string
    }
}

class D extends C {
>D : D
>C : C

    quill = this.foo // ok
>quill : string
>this.foo : string
>this : this
>foo : string
}

class E {
>E : E

    bar = () => this.foo1 + this.foo2; // both ok
>bar : () => string
>() => this.foo1 + this.foo2 : () => string
>this.foo1 + this.foo2 : string
>this.foo1 : string
>this : this
>foo1 : string
>this.foo2 : string
>this : this
>foo2 : string

    foo1 = '';
>foo1 : string
>'' : ""

    constructor(public foo2: string) {}
>foo2 : string
}

class F {
>F : F

    Inner = class extends F {
>Inner : typeof (Anonymous class)
>class extends F {        p2 = this.p1    } : typeof (Anonymous class)
>F : F

        p2 = this.p1
>p2 : number
>this.p1 : number
>this : this
>p1 : number
    }
    p1 = 0
>p1 : number
>0 : 0
}
class G {
>G : G

    Inner = class extends G {
>Inner : typeof (Anonymous class)
>class extends G {        p2 = this.p1    } : typeof (Anonymous class)
>G : G

        p2 = this.p1
>p2 : number
>this.p1 : number
>this : this
>p1 : number
    }
    constructor(public p1: number) {}
>p1 : number
}
class H {
>H : H

    constructor(public p1: C) {}
>p1 : C

    public p2 = () => {
>p2 : () => string
>() => {        return this.p1.foo;    } : () => string

        return this.p1.foo;
>this.p1.foo : string
>this.p1 : C
>this : this
>p1 : C
>foo : string
    }

    public p3 = () => this.p1.foo;
>p3 : () => string
>() => this.p1.foo : () => string
>this.p1.foo : string
>this.p1 : C
>this : this
>p1 : C
>foo : string
}