-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Disable isStartOfType's lookahead when called from isStartOfParameter #18296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,15): error TS1003: Identifier expected. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2304: Cannot find name 'a'. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2304: Cannot find name 'b'. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2695: Left side of comma operator is unused and has no side effects. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,19): error TS2304: Cannot find name 'c'. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,23): error TS1005: ';' expected. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,26): error TS2304: Cannot find name 'a'. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,28): error TS2304: Cannot find name 'b'. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,30): error TS2304: Cannot find name 'c'. | ||
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2695: Left side of comma operator is unused and has no side effects. | ||
|
|
@@ -18,16 +21,22 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,17): error TS1005 | |
| tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304: Cannot find name 'a'. | ||
|
|
||
|
|
||
| ==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (18 errors) ==== | ||
| ==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (21 errors) ==== | ||
| var tt1 = (a, (b, c)) => a+b+c; | ||
| ~ | ||
| !!! error TS1003: Identifier expected. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm. so we had this test originally? why did not we catch this the first time around then?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed the baseline change but (1) I thought that removal of 3 errors was actually an improvement (2) didn't think it was indicative on any further problem. I also looked at the emitted code and thought it was better -- closer to what was written at least.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well.. the new error is a parse error. so a bit worse than the 3 semantic ones. |
||
| ~ | ||
| !!! error TS2304: Cannot find name 'a'. | ||
| ~ | ||
| !!! error TS2695: Left side of comma operator is unused and has no side effects. | ||
| ~ | ||
| !!! error TS2304: Cannot find name 'b'. | ||
| ~ | ||
| !!! error TS2695: Left side of comma operator is unused and has no side effects. | ||
| ~ | ||
| !!! error TS2304: Cannot find name 'c'. | ||
| ~~ | ||
| !!! error TS1005: ';' expected. | ||
| ~ | ||
| !!! error TS2304: Cannot find name 'a'. | ||
| ~ | ||
| !!! error TS2304: Cannot find name 'b'. | ||
| ~ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression5.ts(1,2): error TS2304: Cannot find name 'bar'. | ||
| tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression5.ts(1,6): error TS2304: Cannot find name 'x'. | ||
|
|
||
|
|
||
| ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression5.ts (2 errors) ==== | ||
| (bar(x, | ||
| ~~~ | ||
| !!! error TS2304: Cannot find name 'bar'. | ||
| ~ | ||
| !!! error TS2304: Cannot find name 'x'. | ||
| () => {}, | ||
| () => {} | ||
| ) | ||
| ) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| //// [parserArrowFunctionExpression5.ts] | ||
| (bar(x, | ||
| () => {}, | ||
| () => {} | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| //// [parserArrowFunctionExpression5.js] | ||
| (bar(x, function () { }, function () { })); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| (bar(x, | ||
| () => {}, | ||
| () => {} | ||
| ) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a more declarative name, like inJSDocType or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. done.