@@ -12870,6 +12870,14 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
12870
12870
9 │ readonly *[e?.e]?() { }
12871
12871
╰────
12872
12872
12873
+ × TS(1090): 'readonly' modifier cannot appear on a parameter.
12874
+ ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:3:9]
12875
+ 2 │ not_constructor(
12876
+ 3 │ readonly r,
12877
+ · ────────
12878
+ 4 │ public pu: number,
12879
+ ╰────
12880
+
12873
12881
× TS(1090): 'public' modifier cannot appear on a parameter.
12874
12882
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:4:9]
12875
12883
3 │ readonly r,
@@ -12902,78 +12910,38 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
12902
12910
8 │ // Also works on AssignmentPattern
12903
12911
╰────
12904
12912
12905
- × TS(1090): 'public' modifier cannot appear on a parameter.
12906
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:10:9]
12907
- 9 │ readonly x = 0,
12908
- 10 │ public y?: number = 0) {}
12909
- · ──────
12910
- 11 │ }
12911
- ╰────
12912
-
12913
- × A parameter property is only allowed in a constructor implementation.
12914
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:3:9]
12915
- 2 │ not_constructor(
12916
- 3 │ readonly r,
12917
- · ──────────
12918
- 4 │ public pu: number,
12919
- ╰────
12920
-
12921
- × A parameter property is only allowed in a constructor implementation.
12922
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:4:9]
12923
- 3 │ readonly r,
12924
- 4 │ public pu: number,
12925
- · ─────────────────
12926
- 5 │ protected po?,
12927
- ╰────
12928
-
12929
- × A parameter property is only allowed in a constructor implementation.
12930
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:5:9]
12931
- 4 │ public pu: number,
12932
- 5 │ protected po?,
12933
- · ─────────────
12934
- 6 │ private pi?: number,
12935
- ╰────
12936
-
12937
- × A parameter property is only allowed in a constructor implementation.
12938
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:6:9]
12939
- 5 │ protected po?,
12940
- 6 │ private pi?: number,
12941
- · ───────────────────
12942
- 7 │ public readonly pur,
12943
- ╰────
12944
-
12945
- × A required parameter cannot follow an optional parameter.
12946
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:7:9]
12913
+ × TS(1090): 'readonly' modifier cannot appear on a parameter.
12914
+ ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:7:16]
12947
12915
6 │ private pi?: number,
12948
12916
7 │ public readonly pur,
12949
- · ───────────────────
12950
- 8 │ // Also works on AssignmentPattern
12951
- ╰────
12952
-
12953
- × A parameter property is only allowed in a constructor implementation.
12954
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:7:9]
12955
- 6 │ private pi?: number,
12956
- 7 │ public readonly pur,
12957
- · ───────────────────
12917
+ · ────────
12958
12918
8 │ // Also works on AssignmentPattern
12959
12919
╰────
12960
12920
12961
- × A parameter property is only allowed in a constructor implementation .
12921
+ × TS(1090): 'readonly' modifier cannot appear on a parameter .
12962
12922
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:9:9]
12963
12923
8 │ // Also works on AssignmentPattern
12964
12924
9 │ readonly x = 0,
12965
- · ──────────────
12925
+ · ────────
12966
12926
10 │ public y?: number = 0) {}
12967
12927
╰────
12968
12928
12969
- × A parameter property is only allowed in a constructor implementation .
12929
+ × TS(1090): 'public' modifier cannot appear on a parameter .
12970
12930
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:10:9]
12971
12931
9 │ readonly x = 0,
12972
12932
10 │ public y?: number = 0) {}
12973
- · ─────────────────────
12933
+ · ──────
12974
12934
11 │ }
12975
12935
╰────
12976
12936
12937
+ × A required parameter cannot follow an optional parameter.
12938
+ ╭─[babel/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-not-constructor/input.ts:7:9]
12939
+ 6 │ private pi?: number,
12940
+ 7 │ public readonly pur,
12941
+ · ───────────────────
12942
+ 8 │ // Also works on AssignmentPattern
12943
+ ╰────
12944
+
12977
12945
× TS(18010): An accessibility modifier cannot be used with a private identifier.
12978
12946
╭─[babel/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/input.ts:2:3]
12979
12947
1 │ class A {
@@ -13158,6 +13126,14 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
13158
13126
· ──
13159
13127
╰────
13160
13128
13129
+ × TS(1090): 'readonly' modifier cannot appear on a parameter.
13130
+ ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:2:3]
13131
+ 1 │ function foo(
13132
+ 2 │ readonly r,
13133
+ · ────────
13134
+ 3 │ public pu: number,
13135
+ ╰────
13136
+
13161
13137
× TS(1090): 'public' modifier cannot appear on a parameter.
13162
13138
╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:3:3]
13163
13139
2 │ readonly r,
@@ -13190,78 +13166,38 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
13190
13166
7 │ readonly x = 0,
13191
13167
╰────
13192
13168
13193
- × TS(1090): 'public' modifier cannot appear on a parameter.
13194
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:8:3]
13195
- 7 │ readonly x = 0,
13196
- 8 │ public y?: number = 0
13197
- · ──────
13198
- 9 │ ) {}
13199
- ╰────
13200
-
13201
- × A parameter property is only allowed in a constructor implementation.
13202
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:2:3]
13203
- 1 │ function foo(
13204
- 2 │ readonly r,
13205
- · ──────────
13206
- 3 │ public pu: number,
13207
- ╰────
13208
-
13209
- × A parameter property is only allowed in a constructor implementation.
13210
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:3:3]
13211
- 2 │ readonly r,
13212
- 3 │ public pu: number,
13213
- · ─────────────────
13214
- 4 │ protected po?,
13215
- ╰────
13216
-
13217
- × A parameter property is only allowed in a constructor implementation.
13218
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:4:3]
13219
- 3 │ public pu: number,
13220
- 4 │ protected po?,
13221
- · ─────────────
13222
- 5 │ private pi?: number,
13223
- ╰────
13224
-
13225
- × A parameter property is only allowed in a constructor implementation.
13226
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:5:3]
13227
- 4 │ protected po?,
13228
- 5 │ private pi?: number,
13229
- · ───────────────────
13230
- 6 │ public readonly pur,
13231
- ╰────
13232
-
13233
- × A required parameter cannot follow an optional parameter.
13234
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:6:3]
13235
- 5 │ private pi?: number,
13236
- 6 │ public readonly pur,
13237
- · ───────────────────
13238
- 7 │ readonly x = 0,
13239
- ╰────
13240
-
13241
- × A parameter property is only allowed in a constructor implementation.
13242
- ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:6:3]
13169
+ × TS(1090): 'readonly' modifier cannot appear on a parameter.
13170
+ ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:6:10]
13243
13171
5 │ private pi?: number,
13244
13172
6 │ public readonly pur,
13245
- · ─────────── ────────
13173
+ · ────────
13246
13174
7 │ readonly x = 0,
13247
13175
╰────
13248
13176
13249
- × A parameter property is only allowed in a constructor implementation .
13177
+ × TS(1090): 'readonly' modifier cannot appear on a parameter .
13250
13178
╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:7:3]
13251
13179
6 │ public readonly pur,
13252
13180
7 │ readonly x = 0,
13253
- · ──────────────
13181
+ · ────────
13254
13182
8 │ public y?: number = 0
13255
13183
╰────
13256
13184
13257
- × A parameter property is only allowed in a constructor implementation .
13185
+ × TS(1090): 'public' modifier cannot appear on a parameter .
13258
13186
╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:8:3]
13259
13187
7 │ readonly x = 0,
13260
13188
8 │ public y?: number = 0
13261
- · ─────────────────────
13189
+ · ──────
13262
13190
9 │ ) {}
13263
13191
╰────
13264
13192
13193
+ × A required parameter cannot follow an optional parameter.
13194
+ ╭─[babel/packages/babel-parser/test/fixtures/typescript/function/parameter-properties/input.ts:6:3]
13195
+ 5 │ private pi?: number,
13196
+ 6 │ public readonly pur,
13197
+ · ───────────────────
13198
+ 7 │ readonly x = 0,
13199
+ ╰────
13200
+
13265
13201
× A required parameter cannot follow an optional parameter.
13266
13202
╭─[babel/packages/babel-parser/test/fixtures/typescript/function/pattern-optional-parameters/input.ts:1:17]
13267
13203
1 │ function f([]?, {}) {}
0 commit comments