4 ms·
Yes: precedencegroup MyPrecedence {} infix operator +++: MyPrecedence func +++ (lhs: Int, rhs: Int) -> Int { lhs + rhs } let a = 1 + 2 +++ 3 E
by superlopuh 5y ago
Yes:
precedencegroup MyPrecedence {}
infix operator +++: MyPrecedence
func +++ (lhs: Int, rhs: Int) -> Int { lhs + rhs }
let a = 1 + 2 +++ 3
Error:
Adjacent operators are in unordered precedence groups 'AdditionPrecedence' and 'MyPrecedence'
- daniellehmann 5y agoVery cool, thanks a lot for the example!