Skip to content

Instantly share code, notes, and snippets.

@xissburg
Created May 18, 2015 17:28
Show Gist options
  • Save xissburg/64093d05dc302cb27be6 to your computer and use it in GitHub Desktop.
Save xissburg/64093d05dc302cb27be6 to your computer and use it in GitHub Desktop.
class A {
func test() {
print("A")
}
}
class B: A {
override func test() {
print("B")
}
}
let block = { (b: B?) -> Void in
if let b = b {
b.test()
}
}
let a: A? = nil
//...
block(a as? B?) // Value of optional type 'B??' not unwrapped; did you mean to use '!' or '?'?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment