Make image literals non-optional by routing delegation of non-failable

literal initializer to underlying failable initializer through
implicitly-failable initializer (proper solution is covered in
22276505).

<rdar://problem/20788137> Image literals should not be optional

Swift SVN r31229
This commit is contained in:
Chris Willmore
2015-08-13 22:11:47 +00:00
parent 0c39ec02fa
commit e4ff8fdc05
4 changed files with 14 additions and 7 deletions

View File

@@ -203,10 +203,10 @@ public protocol _ColorLiteralConvertible {
init(colorLiteralRed: Float, green: Float, blue: Float, alpha: Float)
}
/// Optionals of conforming types can be initialized with image literals (e.g.
/// Conforming types can be initialized with image literals (e.g.
/// `[#Image(imageLiteral: "hi.png")#]`).
public protocol _ImageLiteralConvertible {
init?(imageLiteral: String)
init(imageLiteral: String)
}
#endif // SWIFT_ENABLE_OBJECT_LITERALS