Skip to content

Instantly share code, notes, and snippets.

@idrougge
Created November 11, 2019 18:44
Show Gist options
  • Save idrougge/6561b8528d71b7114c5756d4697f21f6 to your computer and use it in GitHub Desktop.
Save idrougge/6561b8528d71b7114c5756d4697f21f6 to your computer and use it in GitHub Desktop.
IUO is not Optional
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