-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New rest parameter properties error message #9298
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
392fe47
Add new error for rest parameters
OrangeShark 1a66f54
Add error message for rest parameter properties
OrangeShark 65bd8e5
Accept rest parameter properties error baselines
OrangeShark 20f8c33
Change binding pattern parameter property error
OrangeShark 6a4400a
Accept binding pattern properties error baselines
OrangeShark be662e1
Change test comment and accept baseline
OrangeShark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
12 changes: 6 additions & 6 deletions
12
tests/baselines/reference/declarationEmitDestructuringParameterProperties.errors.txt
This file contains hidden or 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,28 +1,28 @@ | ||
| tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts(2,17): error TS1187: A parameter property may not be a binding pattern. | ||
| tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts(8,17): error TS1187: A parameter property may not be a binding pattern. | ||
| tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts(14,17): error TS1187: A parameter property may not be a binding pattern. | ||
| tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts(2,17): error TS1187: A parameter property may not be declared using a binding pattern. | ||
| tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts(8,17): error TS1187: A parameter property may not be declared using a binding pattern. | ||
| tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts(14,17): error TS1187: A parameter property may not be declared using a binding pattern. | ||
|
|
||
|
|
||
| ==== tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts (3 errors) ==== | ||
| class C1 { | ||
| constructor(public [x, y, z]: string[]) { | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS1187: A parameter property may not be a binding pattern. | ||
| !!! error TS1187: A parameter property may not be declared using a binding pattern. | ||
| } | ||
| } | ||
|
|
||
| type TupleType1 =[string, number, boolean]; | ||
| class C2 { | ||
| constructor(public [x, y, z]: TupleType1) { | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS1187: A parameter property may not be a binding pattern. | ||
| !!! error TS1187: A parameter property may not be declared using a binding pattern. | ||
| } | ||
| } | ||
|
|
||
| type ObjType1 = { x: number; y: string; z: boolean } | ||
| class C3 { | ||
| constructor(public { x, y, z }: ObjType1) { | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS1187: A parameter property may not be a binding pattern. | ||
| !!! error TS1187: A parameter property may not be declared using a binding pattern. | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,23): error TS1005: ',' expected. | ||
| tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,16): error TS1317: A parameter property cannot be declared using a rest parameter. | ||
|
|
||
|
|
||
| ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (1 errors) ==== | ||
| class Foo3 { | ||
| // Doesn't work, but should | ||
| constructor (public ...args: string[]) { } | ||
| ~~~ | ||
| !!! error TS1005: ',' expected. | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS1317: A parameter property cannot be declared using a rest parameter. | ||
| } |
This file contains hidden or 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 hidden or 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,9 +1,9 @@ | ||
| tests/cases/compiler/restParamModifier2.ts(2,24): error TS1005: ',' expected. | ||
| tests/cases/compiler/restParamModifier2.ts(2,17): error TS1317: A parameter property cannot be declared using a rest parameter. | ||
|
|
||
|
|
||
| ==== tests/cases/compiler/restParamModifier2.ts (1 errors) ==== | ||
| class C { | ||
| constructor(public ...rest: string[]) {} | ||
| ~~~ | ||
| !!! error TS1005: ',' expected. | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS1317: A parameter property cannot be declared using a rest parameter. | ||
| } |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why wasn't this an error before? weird.
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.
I checked the git history and they never had an error when they were added. Seems it has something to do with the other bogus baselines. They have always outputted the correct error in the compiler.