Skip to content

Commit 2032da0

Browse files
committed
[Test] Add type checker performance tests using description(with:) and
count(where:).
1 parent 1737303 commit 2032da0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1 -solver-disable-shrink
2+
// REQUIRES: tools-release,no_asan
3+
4+
struct Date {
5+
var description: String
6+
func description(with: Int) -> String { "" }
7+
}
8+
9+
struct DatabaseLog {
10+
let string: String
11+
let values: [String]
12+
let date: Date
13+
14+
var description: String {
15+
return "[" + string + "] [" + date.description + "] " + string + " [" + values.joined(separator: ", ") + "]"
16+
}
17+
}
18+
19+
extension Sequence {
20+
public func count(
21+
where predicate: (Element) throws -> Bool
22+
) rethrows -> Int { 0 }
23+
}
24+
25+
26+
func rdar47742750(arr1: [Int], arr2: [Int]?) {
27+
let _ = {
28+
assert(arr1.count == arr1.count + (arr2 == nil ? 0 : 1 + arr2!.count + arr2!.count + arr2!.count))
29+
}
30+
}

0 commit comments

Comments
 (0)