Skip to content

Add a public API to look up an infix operator by name. #810

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
Sep 18, 2022

Conversation

allevato
Copy link
Member

Rather than limit myself in with an API specifically for the precedence group, returning the full Operator value seems more flexible/future-proof.

I added analogs for prefix and postfix operators, and then realized when writing tests that the defaultOperators set doesn't include those yet! So I stuck with just the infix API and we can revisit prefix/postfix later—it doesn't seem right to offer those public APIs if they don't have the expected behavior when called on defaultOperators yet.

@allevato allevato requested a review from DougGregor September 17, 2022 21:22
@allevato allevato requested a review from ahoppen as a code owner September 17, 2022 21:22
@allevato
Copy link
Member Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Thank you! I agree that we should add prefix/postfix operator lookups once we've updated the standard and logical operator sets.

@DougGregor DougGregor merged commit b4cbf40 into swiftlang:main Sep 18, 2022
@allevato allevato deleted the lookup-operator-precedence branch September 18, 2022 03:31
@DougGregor
Copy link
Member

I went ahead and added prefix/postfix operators and lookup functions in #819

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