Change the meaning of "if let x = foo()" back to Xcode 6.4 semantics. The compiler

includes a number of QoI things to help people write the correct code.  I will commit
the testcase for it as the next patch.

The bulk of this patch is moving the stdlib, testsuite and validation testsuite to
the new syntax.  I moved a few uses of "as" patterns back to as? expressions in the 
stdlib as well.



Swift SVN r27959
This commit is contained in:
Chris Lattner
2015-04-30 04:38:13 +00:00
parent 62ad8b2dd6
commit 31c01eab73
102 changed files with 524 additions and 538 deletions

View File

@@ -337,7 +337,7 @@ public struct UTF8 : UnicodeCodecType {
if _lookaheadFlags & 0b1111_0000 == 0 {
// Add more bytes into the buffer until we have 4.
while _lookaheadFlags != 0b0000_1111 {
if let codeUnit? = next.next() {
if let codeUnit = next.next() {
_decodeLookahead = (_decodeLookahead << 8) | UInt32(codeUnit)
_lookaheadFlags = (_lookaheadFlags << 1) | 1
} else {
@@ -526,7 +526,7 @@ public struct UTF16 : UnicodeCodecType {
var unit0: UInt32
if _fastPath(_lookaheadFlags & 0b10 == 0) {
if let first? = input.next() {
if let first = input.next() {
unit0 = UInt32(first)
} else {
// Set EOF flag.
@@ -556,7 +556,7 @@ public struct UTF16 : UnicodeCodecType {
// At this point we know that `unit0` is a high-surrogate.
var unit1: UInt32
if let second? = input.next() {
if let second = input.next() {
unit1 = UInt32(second)
} else {
// EOF reached. Set EOF flag.