3

I'm getting this error when trying to convert some Swift 2.x code to Swift 3.x. I've read some posts like this post and the proposal but I don't seem to get it.

infix operator - { associativity left precedence 160 }

What I've tried:

precedencegroup Additive {
    associativity: left
    higherThan: MultiplicationPrecedence
}

Is this right?

Community
  • 1
  • 1
Henny Lee
  • 2,682
  • 3
  • 16
  • 31
  • Isn't operator `-` defined by default with right precedence group? And there's system Additive precedence group already too. Also, why your Additive has higher priority than Multiplicative? [You should check that out](https://en.wikipedia.org/wiki/Order_of_operations). – user28434'mstep Dec 16 '16 at 12:11
  • Well, I was converting the code from https://github.com/inFullMobile/WobbleView and since Multiplicative has a precedence of 150, I thought `precedence 160` translates into `higherThan: MultiplicationPrecendence`. – Henny Lee Dec 16 '16 at 22:01

0 Answers0