Created
May 18, 2015 17:28
-
-
Save xissburg/64093d05dc302cb27be6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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