You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExpressibleByArrayLiteral protocol declares init(arrayLiteral elements: Element...), but according to the documentation it shouldn't be called directly.
@keith Not directly, but I think we can generalize it for all protocols in this "family" based on the proposal that renamed them:
No, it's exactly the opposite, as I keep saying. Conformance to this
protocol does *not* mean you can initialize the type with a literal.
func f<T:IntegerLiteralConvertible>()->T{returnT(integerLiteral:43)// ErrorreturnT(43)// Also an Error}// It means an instance of the type can be *written* as a literal:func f<T:IntegerLiteralConvertible>()->T{return43// OK}
ExpressibleByArrayLiteral
protocol declaresinit(arrayLiteral elements: Element...)
, but according to the documentation it shouldn't be called directly.The types that implement this protocol are:
List obtained from https://developer.apple.com/reference/swift/expressiblebyarrayliteral
The text was updated successfully, but these errors were encountered: