Swift 3: Int is not convertible to Bool in bitwise operation

前端 未结 2 821
醉梦人生
醉梦人生 2021-01-19 19:29

Not sure what I\'m doing wrong here, but here\'s the trivial code that\'s breaking:

if 10 & (1<<18) {
    return
}

This gives me:

2条回答
  •  萌比男神i
    2021-01-19 20:04

    Swift 4 : Check that

    1. Your method has a correct return type which the caller is expecting eg: func yourMethod() -> Bool
    2. The caller method has parentheses () at the end yourMethod()

提交回复
热议问题