我试图在一行if let
中编写以下代码块:
if let amount = datasource?.incrementForCount?(count) {
count += amount
}
else if let amount = datasource?.fixedIncrement {
count += amount
}
当我try 这样的事情时:
if let amount = datasource?.incrementForCount?(count) || let amount = datasource?.fixedIncrement {
count += amount
}
我有一个编译时错误.
我认为where
条款不可能适用于本案.
有没有可能把这两个if let
条语句合并成一个ORed
条语句?