Swift 4-表达过于复杂,无法在合理时间内解决

Swift 4-表达过于复杂,无法在合理时间内解决,swift,compiler-errors,Swift,Compiler Errors,转向SWIFT 4,给出了一个错误“表达式太复杂,不能在合理的时间内解决;考虑把表达式分解成不同的子表达式” let值= Int(topLeft.hashValue)| Int(toplight.hashValue)var value=toplight.hashValue value=value | topRight.hashValue一件一件地做吗let value=Int(topLeft.hashValue);value=value | Int(topRight.hashValue)hash

转向SWIFT 4,给出了一个错误“表达式太复杂,不能在合理的时间内解决;考虑把表达式分解成不同的子表达式”

let值=
Int(topLeft.hashValue)|
Int(toplight.hashValue)
var value=toplight.hashValue

value=value | topRight.hashValue一件一件地做吗<代码>let value=Int(topLeft.hashValue);value=value | Int(topRight.hashValue)
hashValue
已经是一个
Int
您不需要
Int(…)
转换感谢您的帮助,现在一切正常了您还可以使用就地
|=
操作符,例如
value |=topRight.hashValue
let value =
  Int(topLeft.hashValue) |
  Int(topRight.hashValue) << 1 |
  Int(bottomLeft.hashValue) << 2 |
  Int(bottomRight.hashValue) << 3
var value = topLeft.hashValue
    value = value | topRight.hashValue << 1
    value = value | bottomLeft.hashValue << 2
    value = value | bottomRight.hashValue << 3