Skip to content

Fix regression with inout in enum and subscript signatures #17020

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

Conversation

slavapestov
Copy link
Contributor

We were overzealously banning 'inout' in enum and subscript signatures. It can actually appear in the argument list of a nested function type.

Fixes https://bugs.swift.org/browse/SR-7890.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this @slavapestov ! It looks like it might be more complicated to fix because now it rejects single argument with inout and no parens...

@slavapestov
Copy link
Contributor Author

That was just an overzealous cleanup. I can drop one of the patches here.

…ypes

This fixes a 4.2 regression where enums and subscripts could not
contain single-argument function types with an 'inout' parameter,
because we erroneously diagnosed the 'inout' as if it appeared
at the top level of the enum case or subscript index type.

Fixes <https://bugs.swift.org/browse/SR-7890>.
…er name

We should let Sema set ParamDecl's specifier always, instead of setting
it in the parser in this odd corner case where we're recovering from
'inout' being written before the parameter name.
@slavapestov slavapestov force-pushed the enum-subscript-type-resolution branch from 832b8bb to 7f9d364 Compare June 7, 2018 05:56
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit ce7de9b into swiftlang:master Jun 7, 2018
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.

2 participants