@@ -36,12 +36,16 @@ The StringLiteralConvertible Protocol
36
36
-------------------------------------
37
37
38
38
Here is the StringLiteralConvertible protocol as defined in the standard
39
- library's Policy .swift::
39
+ library's CompilerProtocols .swift::
40
40
41
41
// NOTE: the compiler has builtin knowledge of this protocol
42
- protocol StringLiteralConvertible {
42
+ // Conforming types can be initialized with arbitrary string literals.
43
+ public protocol StringLiteralConvertible
44
+ : ExtendedGraphemeClusterLiteralConvertible {
45
+
43
46
typealias StringLiteralType : _BuiltinStringLiteralConvertible
44
- class func convertFromStringLiteral(value : StringLiteralType) -> Self
47
+ // Create an instance initialized to `value`.
48
+ init(stringLiteral value: StringLiteralType)
45
49
}
46
50
47
51
Curiously, the protocol is not defined in terms of primitive types, but in
@@ -58,13 +62,16 @@ points could be constructed...which may be what's desired in some cases.)
58
62
The _BuiltinStringLiteralConvertible Protocol
59
63
---------------------------------------------
60
64
61
- Policy .swift contains a second protocol::
65
+ CompilerProtocols .swift contains a second protocol::
62
66
63
67
// NOTE: the compiler has builtin knowledge of this protocol
64
- protocol _BuiltinStringLiteralConvertible {
65
- class func _convertFromBuiltinStringLiteral(value : Builtin.RawPointer,
66
- byteSize : Builtin.Int64,
67
- isASCII: Builtin.Int1) -> Self
68
+ public protocol _BuiltinStringLiteralConvertible
69
+ : _BuiltinExtendedGraphemeClusterLiteralConvertible {
70
+
71
+ init(
72
+ _builtinStringLiteral start: Builtin.RawPointer,
73
+ byteSize: Builtin.Word,
74
+ isASCII: Builtin.Int1)
68
75
}
69
76
70
77
The use of builtin types makes it clear that this is *only * for use in the
0 commit comments