Skip to content

Commit 8a5d476

Browse files
authored
Fix baselines from bad merge (#47177)
Conflict between #47018 and #46824, both of which changed the behaviour of private fields.
1 parent a423791 commit 8a5d476

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

tests/baselines/reference/privateNameInInExpression(target=es2022).errors.txt

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(21,29): error TS2571: Object is of type 'unknown'.
2-
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2304: Cannot find name '#fiel'.
32
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2339: Property '#fiel' does not exist on type 'any'.
43
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(25,20): error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression
5-
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(27,14): error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression
64
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(27,14): error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access.
75
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type 'boolean'.
86
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(43,27): error TS2531: Object is possibly 'null'.
97
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(114,12): error TS18016: Private identifiers are not allowed outside class bodies.
108

119

12-
==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (9 errors) ====
10+
==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (7 errors) ====
1311
class Foo {
1412
#field = 1;
1513
static #staticField = 2;
@@ -36,8 +34,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.t
3634

3735
const b = #fiel in v; // Bad - typo in privateID
3836
~~~~~
39-
!!! error TS2304: Cannot find name '#fiel'.
40-
~~~~~
4137
!!! error TS2339: Property '#fiel' does not exist on type 'any'.
4238

4339
const c = (#field) in v; // Bad - privateID is not an expression on its own
@@ -46,8 +42,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.t
4642

4743
for (#field in v) { /**/ } // Bad - 'in' not allowed
4844
~~~~~~
49-
!!! error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression
50-
~~~~~~
5145
!!! error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access.
5246

5347
for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any

tests/baselines/reference/privateNameInInExpression(target=esnext).errors.txt

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(21,29): error TS2571: Object is of type 'unknown'.
2-
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2304: Cannot find name '#fiel'.
32
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2339: Property '#fiel' does not exist on type 'any'.
43
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(25,20): error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression
5-
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(27,14): error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression
64
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(27,14): error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access.
75
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type 'boolean'.
86
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(43,27): error TS2531: Object is possibly 'null'.
97
tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(114,12): error TS18016: Private identifiers are not allowed outside class bodies.
108

119

12-
==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (9 errors) ====
10+
==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (7 errors) ====
1311
class Foo {
1412
#field = 1;
1513
static #staticField = 2;
@@ -36,8 +34,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.t
3634

3735
const b = #fiel in v; // Bad - typo in privateID
3836
~~~~~
39-
!!! error TS2304: Cannot find name '#fiel'.
40-
~~~~~
4137
!!! error TS2339: Property '#fiel' does not exist on type 'any'.
4238

4339
const c = (#field) in v; // Bad - privateID is not an expression on its own
@@ -46,8 +42,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.t
4642

4743
for (#field in v) { /**/ } // Bad - 'in' not allowed
4844
~~~~~~
49-
!!! error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression
50-
~~~~~~
5145
!!! error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access.
5246

5347
for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any

0 commit comments

Comments
 (0)