[swift-evolution] [swift-evolution-announce] [Review] SE-0041: Updating Protocol Naming Conventions for Conversions
Ben Rimmington
me at benrimmington.com
Mon May 23 05:48:50 CDT 2016
Dave Abrahams wrote:
>
> Erica Sadun wrote:
>
> > The whole discussion started because ArrayLiteralConvertible meant
> > "can be initialized from Array literal", and not "can be converted to
> > array literal", which is what nearly everyone this was presented to in
> > an informal study thought it meant.
>
> Actually, it means “can be the type of an array literal.” An array
> literal is an expression, not an object. Roughly speaking, the type
> checker decides what type the array literal has by finding the
> best-matching type that conform to the protocol, and the code generator
> injects the necessary calls to the initializer.
ArrayLiteralExpressible
BooleanLiteralExpressible
CharacterLiteralExpressible (was ExtendedGraphemeClusterLiteralConvertible)
DictionaryLiteralExpressible
FloatingPointLiteralExpressible (was FloatLiteralConvertible)
IntegerLiteralExpressible
NilLiteralExpressible
StringInterpolationExpressible (or InterpolativeStringLiteralExpressible)‡
StringLiteralExpressible
UnicodeScalarLiteralExpressible
‡ <http://thread.gmane.org/gmane.comp.lang.swift.evolution/17229>
-- Ben
More information about the swift-evolution
mailing list