Skip to content

[CS] Enforce that withPathElement is called on an lvalue #28498

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 2 commits into from
Dec 2, 2019

Conversation

hamishknight
Copy link
Contributor

Locator builders store a pointer to their underlying locator, so it's not generally sound to extend an rvalue locator builder (I was recently bit by this when attempting to extend a locator builder with multiple elements).

This PR enforces that withPathElement is called on an lvalue, and adds a couple more overloads of getConstraintLocator to make it more convenient to extend locators with multiple elements.

Locator builders keep a pointer to their underlying
locator, so it's not generally sound to extend an
rvalue locator builder.

This commit enforces that withPathElement is called
on an lvalue, and adds a couple more overloads of
getConstraintLocator to make it more convenient to
extend locators with multiple elements.
@hamishknight hamishknight requested a review from xedin November 28, 2019 01:18
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 926066a into swiftlang:master Dec 2, 2019
@hamishknight hamishknight deleted the warranty-void branch December 2, 2019 19:31
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