mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
444 B
Swift
21 lines
444 B
Swift
// RUN: %target-run-simple-swift | FileCheck %s
|
|
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
|
|
|