Files
swift-mirror/test/Interpreter/SDK/objc_currying.swift

24 lines
480 B
Swift

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