Files
swift-mirror/test/Interpreter/class_in_constrained_extension.swift
2018-03-01 14:31:43 -08:00

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)