Skip to content

Commit 886d2fc

Browse files
committed
Merge pull request #240 from Viewtiful/doc-literals/change-protocols-impl
Literals.rst: change protocols location
2 parents d25ee13 + 059688a commit 886d2fc

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/Literals.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ The StringLiteralConvertible Protocol
3636
-------------------------------------
3737

3838
Here is the StringLiteralConvertible protocol as defined in the standard
39-
library's Policy.swift::
39+
library's CompilerProtocols.swift::
4040

4141
// 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+
4346
typealias StringLiteralType : _BuiltinStringLiteralConvertible
44-
class func convertFromStringLiteral(value : StringLiteralType) -> Self
47+
// Create an instance initialized to `value`.
48+
init(stringLiteral value: StringLiteralType)
4549
}
4650

4751
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.)
5862
The _BuiltinStringLiteralConvertible Protocol
5963
---------------------------------------------
6064

61-
Policy.swift contains a second protocol::
65+
CompilerProtocols.swift contains a second protocol::
6266

6367
// 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)
6875
}
6976

7077
The use of builtin types makes it clear that this is *only* for use in the

0 commit comments

Comments
 (0)