Make "true" and "false" Boolean literal constants for the BooleanLiteralConvertible protocol.

Introduce the new BooleanLiteralConvertible protocol for Boolean
literals. Take "true" and "false" as real keywords (which is most of the
reason for the testsuite churn). Make Bool BooleanLiteralConvertible
and the default Boolean literal type, and ObjCBool
BooleanLiteralConvertible. Fixes <rdar://problem/17405310> and the
recent regression that made ObjCBool not work with true/false.


Swift SVN r19728
This commit is contained in:
Doug Gregor
2014-07-09 16:57:35 +00:00
parent f0621d1563
commit 2f3f6acf21
57 changed files with 312 additions and 169 deletions

View File

@@ -500,7 +500,7 @@ extension String {
var stop_ = false
body(line: line!, stop: &stop_)
if stop_ {
UnsafePointer<ObjCBool>(stop).memory = ObjCBool(true)
UnsafePointer<ObjCBool>(stop).memory = true
}
}
}