Files
swift-mirror/test/Interpreter/SDK/objc_currying.swift
Chris Lattner 31c01eab73 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
2015-04-30 04:38:13 +00:00

23 lines
471 B
Swift

// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: objc_interop
import Foundation
func foo(f: (String) -> String) {
println(f(", "))
println(f(""))
}
let x: NSArray = ["foo", "bar", "bas"]
foo(x.componentsJoinedByString)
// CHECK: foo, bar, bas
// CHECK: foo bar bas
let a: AnyObject = x
if let componentsJoinedByString = a.componentsJoinedByString {
foo(componentsJoinedByString)
}
// CHECK: foo, bar, bas
// CHECK: foo bar bas