mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
17 lines
339 B
Swift
17 lines
339 B
Swift
// RUN: %target-run-simple-swift | %FileCheck %s
|
|
// REQUIRES: executable_test
|
|
|
|
class Foo {}
|
|
|
|
extension Array where Element == Foo {
|
|
class Bar { var foo = Foo() }
|
|
|
|
init(withAThing: String) {
|
|
self = [Bar(), Bar(), Bar()].map { $0.foo }
|
|
}
|
|
}
|
|
|
|
// CHECK: [main.Foo, main.Foo, main.Foo]
|
|
let foos = [Foo](withAThing: "Hi")
|
|
print(foos)
|