blob: 6c8cb5e2e7781a5b3619cb2ac2f76db82b7d1564 [file] [log] [blame]
// 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