forked from microsoft/TypeScript
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
47 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 1 addition & 10 deletions
11
tests/baselines/reference/logicalAssignment7(target=es2015).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(2,6): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(6,6): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(10,5): error TS2532: Object is possibly 'undefined'. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(10,6): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(10,40): error TS2345: Argument of type '100' is not assignable to parameter of type 'never'. | ||
|
||
|
||
==== tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts (5 errors) ==== | ||
==== tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts (2 errors) ==== | ||
function foo1(results: number[] | undefined, results1: number[] | undefined) { | ||
(results ||= results1 ||= []).push(100); | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
} | ||
|
||
function foo2(results: number[] | undefined, results1: number[] | undefined) { | ||
(results ??= results1 ??= []).push(100); | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
} | ||
|
||
function foo3(results: number[] | undefined, results1: number[] | undefined) { | ||
(results &&= results1 &&= []).push(100); | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2532: Object is possibly 'undefined'. | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
~~~ | ||
!!! error TS2345: Argument of type '100' is not assignable to parameter of type 'never'. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 1 addition & 10 deletions
11
tests/baselines/reference/logicalAssignment7(target=es2020).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(2,6): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(6,6): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(10,5): error TS2532: Object is possibly 'undefined'. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(10,6): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts(10,40): error TS2345: Argument of type '100' is not assignable to parameter of type 'never'. | ||
|
||
|
||
==== tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts (5 errors) ==== | ||
==== tests/cases/conformance/esnext/logicalAssignment/logicalAssignment7.ts (2 errors) ==== | ||
function foo1(results: number[] | undefined, results1: number[] | undefined) { | ||
(results ||= results1 ||= []).push(100); | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
} | ||
|
||
function foo2(results: number[] | undefined, results1: number[] | undefined) { | ||
(results ??= results1 ??= []).push(100); | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
} | ||
|
||
function foo3(results: number[] | undefined, results1: number[] | undefined) { | ||
(results &&= results1 &&= []).push(100); | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2532: Object is possibly 'undefined'. | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. | ||
~~~ | ||
!!! error TS2345: Argument of type '100' is not assignable to parameter of type 'never'. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.