typelift / Swiftx

Functional data types and functions for any project
BSD 3-Clause "New" or "Revised" License
219 stars 28 forks source link

Can't assign result of pipe operator #54

Closed CosynPa closed 8 years ago

CosynPa commented 8 years ago
func f(x: Int) -> Int {
    return 0
}

var x = 0
x = 5 |> f // error

Since the precedence group has no order relationship with AssignmentPrecedence:

precedencegroup LeftAssociativeCombinatorPrecedence {
    associativity: left
    lowerThan: DefaultPrecedence
}

Is this intended behaviour? Before Swift 3, we had precedence 95 which is lower than ternary operator (100) and higher than assignment (90).

CodaFi commented 8 years ago

All of the precedencegroups we have are subject to revision right now, so thank you for reporting this. Would you mind opening a pull request against typelift/Operadics for this? If you can't find the time to do so, I will get to this tonight.

CodaFi commented 8 years ago

Thank you again for reporting this, it has been resolved by the merge of #55.