Hi,
Just looking into a frustrating case with protocols and wondering if this would be a good pitch for a language change.
When using optionals in a protocol, conformers who’s optional type is implicitly unwrapped causes an error in the compiler.
Eg:
protocol TextEntryView {
var text: String?
}
// This works.
class UITextField: TextEntryView {}
// This doesn't work because it's declaration has `text: String!`
class UITextView: TextEntryView {}
Given the content of SE-0054 which abolishes the implicitly unwrapped type and making it optional with an implicit unwrapping behavior, should we allow protocol conformance where the conformers optional type is implicitly unwrapped?
I can see good reason for avoiding this where the protocol declares implicit unwrapping and the conformer has a standard optional due to safety reasons, but vice versa has no such issues.
Thoughts?