-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[SE-0031] Adjusting 'inout' Declarations for Type Decoration #1333
Conversation
@@ -186,9 +186,10 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc, | |||
status |= makeParserCodeCompletionStatus(); | |||
} | |||
} | |||
|
|||
SourceLoc depercatedInoutLoc; |
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.
There's a typo here: should be deprecatedInoutLoc
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.
@chriseidhof fixed. Thanks Chris!
6eb9e4b
to
e6148c5
Compare
Totally awesome, thank you for working on this @dduan. I have some specific comments which I'll comment on the diff itself. |
@@ -145,6 +145,9 @@ WARNING(lex_editor_placeholder_in_playground,none, | |||
|
|||
NOTE(note_in_decl_extension,none, | |||
"in %select{declaration|extension}0 of %1", (bool, Identifier)) | |||
WARNING(inout_as_attr_deprecated,none, | |||
"'inout' as parameter attribute is deprecated, prefix type with it instead.", |
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.
This reads awkwardly, and diagnostic messages should not end with a period. I'd suggest something like:
'inout' before a parameter name is deprecated, place it before the parameter type instead
That's all I see. The test suite changes all look great, please send a patch to update the standard library as well. Thank you again for implementing this @dduan! |
This commit implements [SE-0031](//github.com/apple/swift-evolution/blob/master/proposals/0031-adjusting-inout-declarations.md). When `inout` appears before parameter name, the parser issues a warning and suggests the correct alternate location for it. `inout` prefixing the paramter type is now valid.
Thanks for the review, Chris! I've addressed your comments to my best extent and pushed the changes up. I have the patch for stdlib ready to go. Just waiting for this one to merge :) |
[SE-0031] Adjusting 'inout' Declarations for Type Decoration
Awesome, thanks again! |
As the title indicates, this PR implements SE-0031.
inout
position.SE-0031
inout
appears in both position, only the fixit for removal is issued