Skip to content
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

[SR-10980] Add FixIt for "Operator should no longer be declared with a body; use a precedence group instead" #53369

Open
harlanhaskins opened this issue Jun 20, 2019 · 0 comments
Labels
compiler The Swift compiler in itself improvement

Comments

@harlanhaskins
Copy link
Collaborator

Previous ID SR-10980
Radar rdar://51138331
Original Reporter @harlanhaskins
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: 325bb2f17d27851e3a2edb7163065ffc

Issue Description:

Before Swift 3, operators were declared with this syntax:

infix operator <=> {
  associativity right
  precedence 150
}

Now, they are declared using precedence groups, like so:

precedencegroup SpaceshipPrecedence {
  associativity: right
  higherThan: ComparisonPrecedence
}

infix operator <=> : SpaceshipPrecedence

It would be nice to have a Fix-It that converts the old-style declaration to a new-style. It wouldn't be possible to deduce 'higherThan' from a numeric precedence, but you could get the user most of the way there.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

1 participant