|
| 1 | +// RUN: %target-swift-ide-test -print-indexed-symbols -source-filename %s | %FileCheck %s |
| 2 | + |
| 3 | +struct Foo: Hashable {} |
| 4 | + |
| 5 | +_ = Array<Int>(repeating: 0, count: 1) |
| 6 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(repeating:count:) | s:Sa9repeating5countSayxGx_Sitcfc | {{.*}}Ref |
| 7 | +_ = [Int](repeating: 0, count: 1) |
| 8 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(repeating:count:) | s:Sa9repeating5countSayxGx_Sitcfc | {{.*}}Ref |
| 9 | +_ = Array<Foo>(repeating: Foo(), count: 1) |
| 10 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(repeating:count:) | s:Sa9repeating5countSayxGx_Sitcfc | {{.*}}Ref |
| 11 | +// CHECK: [[@LINE-2]]:27 | constructor/Swift | init() | s:14swift_ide_test3FooVACycfc | Ref,Call |
| 12 | +_ = [Foo](repeating: Foo(), count: 1) |
| 13 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(repeating:count:) | s:Sa9repeating5countSayxGx_Sitcfc | {{.*}}Ref |
| 14 | +// CHECK: [[@LINE-2]]:22 | constructor/Swift | init() | s:14swift_ide_test3FooVACycfc | Ref,Call |
| 15 | + |
| 16 | +_ = Dictionary<Foo, String>(minimumCapacity: 1) |
| 17 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(minimumCapacity:) | s:SD15minimumCapacitySDyxq_GSi_tcfc | {{.*}}Ref |
| 18 | +_ = [Foo: String](minimumCapacity: 1) |
| 19 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(minimumCapacity:) | s:SD15minimumCapacitySDyxq_GSi_tcfc | {{.*}}Ref |
| 20 | +_ = [String: Int](uniqueKeysWithValues: zip(["one", "two", "three"], 1...3)) |
| 21 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(uniqueKeysWithValues:) | s:SD20uniqueKeysWithValuesSDyxq_Gqd__n_tcSTRd__x_q_t7ElementRtd__lufc | {{.*}}Ref |
| 22 | + |
| 23 | +extension Array where Element == Int { |
| 24 | +// CHECK: [[@LINE+1]]:3 | constructor/Swift | init(_:) | s:Sa14swift_ide_testSiRszlEySaySiGSicfc | {{.*}}Def |
| 25 | + init(_ input: Int) { |
| 26 | + self = [input] |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +_ = [Int](0) |
| 31 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(_:) | s:Sa14swift_ide_testSiRszlEySaySiGSicfc | {{.*}}Ref |
| 32 | + |
| 33 | +extension Dictionary { |
| 34 | +// CHECK: [[@LINE+1]]:3 | constructor/Swift | init(_:_:) | s:SD14swift_ide_testEySDyxq_Gx_q_tcfc | {{.*}}Def |
| 35 | + init(_ k: Key, _ v: Value) { |
| 36 | + self = [k: v] |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +_ = [Int: Int](0, 1) |
| 41 | +// CHECK: [[@LINE-1]]:5 | constructor/Swift | init(_:_:) | s:SD14swift_ide_testEySDyxq_Gx_q_tcfc | {{.*}}Ref |
0 commit comments