You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only issue matching token errors on non-dupe locations (#43460)
* Only issue matching token errors on non-dupe locations
Intead of unconditionally retrieving the last error and attaching a
related span, `parseErrorAt` and friends now return the last error and
return `false` when there is none.
Also make one more place use parseExpectedMatchingBrackets that I missed
last time.
* Inline parseTokenForError, return undefined not false
* skip redundant undefined assignment
* address PR comments
!!! related TS1007 tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts:257:33: The parser expected to find a ')' to match the '(' token here.
509
508
~~~~~~
510
509
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
40
40
~
41
41
!!! error TS1005: ',' expected.
42
-
!!! related TS1007 tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts:7:4: The parser expected to find a ']' to match the '[' token here.
43
42
a0([1, 2, [["world"]], "string"]); // Error
44
43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
44
!!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'.
!!! related TS1007 tests/cases/compiler/errorRecoveryWithDotFollowedByNamespaceKeyword.ts:3:19: The parser expected to find a '}' to match the '{' token here.
20
-
!!! related TS1007 tests/cases/compiler/errorRecoveryWithDotFollowedByNamespaceKeyword.ts:2:20: The parser expected to find a '}' to match the '{' token here.
19
+
!!! related TS1007 tests/cases/compiler/errorRecoveryWithDotFollowedByNamespaceKeyword.ts:3:19: The parser expected to find a '}' to match the '{' token here.
Copy file name to clipboardExpand all lines: tests/baselines/reference/objectSpreadNegativeParse.errors.txt
-1
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,6 @@ tests/cases/conformance/types/spread/objectSpreadNegativeParse.ts(4,20): error T
28
28
!!! error TS2304: Cannot find name 'matchMedia'.
29
29
~
30
30
!!! error TS1005: ',' expected.
31
-
!!! related TS1007 tests/cases/conformance/types/spread/objectSpreadNegativeParse.ts:3:10: The parser expected to find a '}' to match the '{' token here.
32
31
~
33
32
!!! error TS1128: Declaration or statement expected.
!!! related TS1007 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts:1:17: The parser expected to find a ']' to match the '[' token here.
12
11
~~~~~~~~~
13
12
!!! error TS2695: Left side of comma operator is unused and has no side effects.
Copy file name to clipboardExpand all lines: tests/baselines/reference/parserFuzz1.errors.txt
+1-2
Original file line number
Diff line number
Diff line change
@@ -20,5 +20,4 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,15): e
20
20
~~~~~~
21
21
!!! error TS1005: ';' expected.
22
22
23
-
!!! error TS1005: '{' expected.
24
-
!!! related TS1007 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts:1:9: The parser expected to find a '}' to match the '{' token here.
Copy file name to clipboardExpand all lines: tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js
0 commit comments