Skip to content

[Sema] Fix assert with incorrectly allowing optional injection into operator inout argument. #18135

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
Jul 22, 2018

Conversation

gregomni
Copy link
Contributor

@gregomni gregomni commented Jul 22, 2018

When matching types on an operator 'inout' param and lvalue argument, be more restrictive with the inner match by changing the match kind. Allowing optional injection here is a no no.

Resolves SR-8221.

@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test and merge.

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.

For changes like these you’d want to run source compatibility suite and ask somebody e.g. @rudkx to take a look before merging...

@gregomni
Copy link
Contributor Author

@xedin Alrighty. Is there a way to tell swift-ci not to merge after all? A quick look about the docs doesn't reveal anything to me..

@gregomni
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci swift-ci merged commit a9407ad into swiftlang:master Jul 22, 2018
@xedin
Copy link
Contributor

xedin commented Jul 23, 2018

Only if you force push while it’s running, that’s going to abort the job.

@gregomni
Copy link
Contributor Author

FWIW, there shouldn't be any functional change here, this is only keeping the constraint system from coming up with an incorrect solution that then hits an assert in CSApply when it can't create a valid coercion for that wrong solution.

@xedin
Copy link
Contributor

xedin commented Jul 23, 2018

Understand but since users get builds without asserts it’s possible that this is going to fail one of the projects by either not producing any solutions of a different one, we has multiple times that happened recently when @rudkx tried to land similar changes.

@rudkx
Copy link
Contributor

rudkx commented Jul 23, 2018

This seems like the right fix. inouts parameters and their arguments have to be of the same type.

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