Created
November 11, 2019 18:44
-
-
Save idrougge/6561b8528d71b7114c5756d4697f21f6 to your computer and use it in GitHub Desktop.
IUO is not Optional
This file contains hidden or 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
protocol Countable { | |
var count: Int? {get} | |
} | |
struct OptionalCount: Countable { | |
var count: Int? = 0 | |
} | |
struct DeadlyCount: Countable { // Type 'DeadlyCount' does not conform to protocol 'Countable' | |
var count: Int! = 0 // 1. Candidate has non-matching type 'Int?' <---------- | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment