Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The error "Object is possibly null or undefined" is ambiguous. (#49797)
* added object name to TS2571, 2531, 2532 and 2533 * updated localized diagnostic messages * updated baseline to fit diagnostic message change * Revert "updated localized diagnostic messages" This reverts commit 738cf09. * specialized the error to EntityNameExpression * updated baseline to fit new changes * added multiline undefined access test * added TS18049 - value cannot be used here * adjusted baseline * corrected a small linting issue * Update error numbers after merge from main Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
- Loading branch information
Showing
71 changed files
with
1,793 additions
and
1,622 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
480 changes: 240 additions & 240 deletions
480
tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt
Large diffs are not rendered by default.
Oops, something went wrong.
320 changes: 160 additions & 160 deletions
320
tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.errors.txt
Large diffs are not rendered by default.
Oops, something went wrong.
320 changes: 160 additions & 160 deletions
320
tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt
Large diffs are not rendered by default.
Oops, something went wrong.
480 changes: 240 additions & 240 deletions
480
tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt
Large diffs are not rendered by default.
Oops, something went wrong.
320 changes: 160 additions & 160 deletions
320
tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.errors.txt
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 +1,7 @@ | ||
tests/cases/compiler/binaryArithmatic1.ts(1,13): error TS2531: Object is possibly 'null'. | ||
tests/cases/compiler/binaryArithmatic1.ts(1,13): error TS18050: The value 'null' cannot be used here. | ||
|
||
|
||
==== tests/cases/compiler/binaryArithmatic1.ts (1 errors) ==== | ||
var v = 4 | null; | ||
~~~~ | ||
!!! error TS2531: Object is possibly 'null'. | ||
!!! error TS18050: The value 'null' cannot be used here. |
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,7 +1,7 @@ | ||
tests/cases/compiler/binaryArithmatic2.ts(1,13): error TS2532: Object is possibly 'undefined'. | ||
tests/cases/compiler/binaryArithmatic2.ts(1,13): error TS18050: The value 'undefined' cannot be used here. | ||
|
||
|
||
==== tests/cases/compiler/binaryArithmatic2.ts (1 errors) ==== | ||
var v = 4 | undefined; | ||
~~~~~~~~~ | ||
!!! error TS2532: Object is possibly 'undefined'. | ||
!!! error TS18050: The value 'undefined' cannot be used here. |
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,10 +1,10 @@ | ||
tests/cases/compiler/binaryArithmatic3.ts(1,9): error TS2532: Object is possibly 'undefined'. | ||
tests/cases/compiler/binaryArithmatic3.ts(1,21): error TS2532: Object is possibly 'undefined'. | ||
tests/cases/compiler/binaryArithmatic3.ts(1,9): error TS18050: The value 'undefined' cannot be used here. | ||
tests/cases/compiler/binaryArithmatic3.ts(1,21): error TS18050: The value 'undefined' cannot be used here. | ||
|
||
|
||
==== tests/cases/compiler/binaryArithmatic3.ts (2 errors) ==== | ||
var v = undefined | undefined; | ||
~~~~~~~~~ | ||
!!! error TS2532: Object is possibly 'undefined'. | ||
!!! error TS18050: The value 'undefined' cannot be used here. | ||
~~~~~~~~~ | ||
!!! error TS2532: Object is possibly 'undefined'. | ||
!!! error TS18050: The value 'undefined' cannot be used here. |
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,10 +1,10 @@ | ||
tests/cases/compiler/binaryArithmatic4.ts(1,9): error TS2531: Object is possibly 'null'. | ||
tests/cases/compiler/binaryArithmatic4.ts(1,16): error TS2531: Object is possibly 'null'. | ||
tests/cases/compiler/binaryArithmatic4.ts(1,9): error TS18050: The value 'null' cannot be used here. | ||
tests/cases/compiler/binaryArithmatic4.ts(1,16): error TS18050: The value 'null' cannot be used here. | ||
|
||
|
||
==== tests/cases/compiler/binaryArithmatic4.ts (2 errors) ==== | ||
var v = null | null; | ||
~~~~ | ||
!!! error TS2531: Object is possibly 'null'. | ||
!!! error TS18050: The value 'null' cannot be used here. | ||
~~~~ | ||
!!! error TS2531: Object is possibly 'null'. | ||
!!! error TS18050: The value 'null' cannot be used here. |
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
Oops, something went wrong.