我有以下代码:
postfix operator ^^^
public postfix func ^^^(lhs: Int) -> Int {
return 0
}
public postfix func ^^^<T>(lhs: (T, T)) -> [T] {
return [lhs.0, lhs.1]
}
func go() {
1^^^ // this works
(0, 0)^^^ // error: Unary operator '^^^' cannot be applied to an operand of type '(Int, Int)'
}
我得到了错误,Unary operator '^^^' cannot be applied to an operand of type '(Int, Int)'
. 任何想法如何解决这一问题?