From 6d9c12e571b5e29acd961191f9524db1a61d053a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 17 Dec 2021 11:08:53 -0800 Subject: [PATCH] Fix baselines from bad merge Conflict between #47018 and #46824, both of which changed the behaviour of private fields. --- .../privateNameInInExpression(target=es2022).errors.txt | 8 +------- .../privateNameInInExpression(target=esnext).errors.txt | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/baselines/reference/privateNameInInExpression(target=es2022).errors.txt b/tests/baselines/reference/privateNameInInExpression(target=es2022).errors.txt index d4ba5f81e9fdc..514d2a85e84a6 100644 --- a/tests/baselines/reference/privateNameInInExpression(target=es2022).errors.txt +++ b/tests/baselines/reference/privateNameInInExpression(target=es2022).errors.txt @@ -1,15 +1,13 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(21,29): error TS2571: Object is of type 'unknown'. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2304: Cannot find name '#fiel'. tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2339: Property '#fiel' does not exist on type 'any'. 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 -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 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. 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'. tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(43,27): error TS2531: Object is possibly 'null'. tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(114,12): error TS18016: Private identifiers are not allowed outside class bodies. -==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (9 errors) ==== +==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (7 errors) ==== class Foo { #field = 1; static #staticField = 2; @@ -36,8 +34,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.t const b = #fiel in v; // Bad - typo in privateID ~~~~~ -!!! error TS2304: Cannot find name '#fiel'. - ~~~~~ !!! error TS2339: Property '#fiel' does not exist on type 'any'. 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 for (#field in v) { /**/ } // Bad - 'in' not allowed ~~~~~~ -!!! 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 - ~~~~~~ !!! error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access. for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any diff --git a/tests/baselines/reference/privateNameInInExpression(target=esnext).errors.txt b/tests/baselines/reference/privateNameInInExpression(target=esnext).errors.txt index d4ba5f81e9fdc..514d2a85e84a6 100644 --- a/tests/baselines/reference/privateNameInInExpression(target=esnext).errors.txt +++ b/tests/baselines/reference/privateNameInInExpression(target=esnext).errors.txt @@ -1,15 +1,13 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(21,29): error TS2571: Object is of type 'unknown'. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2304: Cannot find name '#fiel'. tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2339: Property '#fiel' does not exist on type 'any'. 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 -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 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. 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'. tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(43,27): error TS2531: Object is possibly 'null'. tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(114,12): error TS18016: Private identifiers are not allowed outside class bodies. -==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (9 errors) ==== +==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (7 errors) ==== class Foo { #field = 1; static #staticField = 2; @@ -36,8 +34,6 @@ tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.t const b = #fiel in v; // Bad - typo in privateID ~~~~~ -!!! error TS2304: Cannot find name '#fiel'. - ~~~~~ !!! error TS2339: Property '#fiel' does not exist on type 'any'. 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 for (#field in v) { /**/ } // Bad - 'in' not allowed ~~~~~~ -!!! 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 - ~~~~~~ !!! error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access. for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any