Skip to content

Commit df83676

Browse files
authored
Merge pull request #70161 from kavon/test-coverage-rdar118360449
[test] add coverage for rdar://118360449
2 parents 8a84f0e + 5672ddf commit df83676

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// RUN: %target-swift-frontend %s -sil-verify-all -emit-sil > /dev/null
2+
3+
// REQUIRES: objc_interop
4+
5+
// Check that we don't get two bogus "copy of noncopyable value" errors in the
6+
// timestamp method.
7+
8+
import Foundation
9+
10+
private struct Boop: Hashable {
11+
let firstName: String
12+
let lastName: String
13+
let time: String?
14+
let source: String?
15+
let destination: String?
16+
17+
init(firstName: String, lastName: String, time: String?, source: String?, destination: String?) {
18+
self.firstName = firstName
19+
self.lastName = lastName
20+
self.time = time
21+
self.source = source
22+
self.destination = destination
23+
}
24+
}
25+
26+
private struct TripEntry {
27+
let displayString: String
28+
let line: Int?
29+
let column: Int?
30+
let memberID: String?
31+
private(set) var timestamp: Boop?
32+
33+
init(_ displayString: String, line: Int? = nil, column: Int? = nil, memberID: String? = nil) {
34+
self.displayString = displayString
35+
self.line = line
36+
self.column = column
37+
self.memberID = memberID
38+
}
39+
40+
consuming func timestamp(from lastName: String, time: String? = nil, source: String? = nil, destination: String? = nil) -> TripEntry {
41+
timestamp = Boop(firstName: displayString.components(separatedBy: " ").first!, lastName: lastName, time: time, source: source, destination: destination)
42+
return self
43+
}
44+
}

0 commit comments

Comments
 (0)