ฉันพยายามประกาศอาร์กิวเมนต์ใน Swift ซึ่งจะปิดทางเลือก ฟังก์ชันที่ฉันประกาศมีลักษณะดังนี้:
class Promise {
 func then(onFulfilled: ()->(), onReject: ()->()?){       
    if let callableRjector = onReject {
      // do stuff! 
    }
 }
}
แต่ Swift บ่นว่า "Bound value in a conditional must be an Optional type" ซึ่งมีการประกาศ "if let"