Skip to content
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

Merged
merged 4 commits into from
Feb 26, 2016

Conversation

dduan
Copy link
Contributor

@dduan dduan commented Feb 17, 2016

As the title indicates, this PR implements SE-0031.

  • A warning is added for old inout position.
  • fixit for removing old inout position and inserting it in new position specified in SE-0031
  • when inout appears in both position, only the fixit for removal is issued
  • various places where inout declaration is printed
  • all tests are updated and passing.

@@ -186,9 +186,10 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
status |= makeParserCodeCompletionStatus();
}
}

SourceLoc depercatedInoutLoc;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chriseidhof fixed. Thanks Chris!

@dduan dduan force-pushed the SE-0031 branch 2 times, most recently from 6eb9e4b to e6148c5 Compare February 23, 2016 00:57
@lattner
Copy link
Contributor

lattner commented Feb 26, 2016

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.",
Copy link
Contributor

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

@lattner
Copy link
Contributor

lattner commented Feb 26, 2016

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.
@dduan
Copy link
Contributor Author

dduan commented Feb 26, 2016

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 :)

lattner added a commit that referenced this pull request Feb 26, 2016
[SE-0031] Adjusting 'inout' Declarations for Type Decoration
@lattner lattner merged commit dfaaebc into swiftlang:master Feb 26, 2016
@lattner
Copy link
Contributor

lattner commented Feb 26, 2016

Awesome, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants