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