Skip to content

[AST] Strip InOutType when cloning a parameter. #12271

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

Closed
wants to merge 2 commits into from

Conversation

DougGregor
Copy link
Member

Fixes rdar://problem/34789779, where initializer inheritance was breaking
in the presence of 'inout' parameters.

Fixes rdar://problem/34789779, where initializer inheritance was breaking
in the presence of 'inout' parameters.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@@ -4197,12 +4197,20 @@ ParamDecl::ParamDecl(Specifier specifier,
"'var' cannot appear on parameters; you meant 'inout'");
}

// Remove the top-level inout type, if there is one.
static Type removeInOutType(Type type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

getInOutObjectType() already handles this and I would rather keep usages of getAs<InOutType>() centralized.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ugh, how did I miss getInOutObjectType()? Search fail, thank you!

@DougGregor DougGregor closed this Oct 4, 2017
@DougGregor
Copy link
Member Author

In my haste to not get this auto-merged, I busted it. Opened a new PR as #12272

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