Skip to content

Sema: Fix bogus 'parameters may not have the 'var' specifier' diagnostic #3855

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 1 commit into from
Aug 2, 2016

Conversation

slavapestov
Copy link
Contributor

Small regression with Swift 3 language changes.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@@ -288,6 +288,11 @@ class alignas(1 << DeclAlignInBits) Decl {
/// once (either in its declaration, or once later), making it immutable.
unsigned IsLet : 1;

/// \brief Whether this is an 'inout' parameter; this is preferrable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Spelling: "preferable"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks :)

If an inout parameter has an invalid type, we were unable to
distinguish it from a 'var' parameter, resulting in an invalid
diagnostic.

Fix this by adding a VarDecl::isInOut() flag, instead of
introspecting the type.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@swift-ci swift-ci merged commit 328866a into swiftlang:master Aug 2, 2016
@slavapestov slavapestov deleted the fix-bad-diagnostic branch August 19, 2016 05:23
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.

4 participants