Skip to content

[ConstraintSystem] Improve type parameter requirement locators #13047

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
Nov 27, 2017

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Nov 22, 2017

When opening generic types with type parameter requirements,
add information about requirement location to the locator of each
generated constraint to make it easier to extract such information
if needed.

@xedin xedin requested a review from DougGregor November 22, 2017 06:49
@xedin
Copy link
Contributor Author

xedin commented Nov 22, 2017

@DougGregor does this seem reasonable to you?

@@ -319,6 +323,11 @@ class ConstraintLocator : public llvm::FoldingSetNode {
assert(getAssociatedType() == decl);
}

PathElement(const swift::Requirement &req, unsigned pos)
Copy link
Member

Choose a reason for hiding this comment

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

req isn't actually used here; can you instead add a static PathElement getTypeRequirement(unsigned position)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do, thanks!

When opening generic types with type parameter requirements,
add information about requirement location to the locator of each
generated constraint to make it easier to extract such information
if needed.
@xedin
Copy link
Contributor Author

xedin commented Nov 27, 2017

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 31f32be into swiftlang:master Nov 27, 2017
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