Skip to content

[CS] Define a class for every locator path element kind #27433

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 3 commits into from
Sep 30, 2019

Conversation

hamishknight
Copy link
Contributor

This is a follow-up to #26297. This PR uses macros to define the different kinds of locator path elements, which then allows us to define a LocatorPathElt subclass for each one. ConstraintLocator::isLastElement is then changed to take a LocatorPathElt subclass, making it consistent with the other last-element casting members.

Finally this PR renames the Requirement path element to ProtocolRequirement in order to help avoid confusion with AnyRequirement.

This allows us to define a `LocatorPathElt`
subclass for each path element kind.
This makes it consistent with `getLastElementAs`
and `castLastElementTo`.
Rename to LocatorPathElt::ProtocolRequirement in
order to help avoid confusion with
LocatorPathElt::AnyRequirement.
@hamishknight hamishknight requested a review from xedin September 29, 2019 22:36
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test

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.

Looks great!

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