Skip to content

Commit d834929

Browse files
authored
Merge pull request #10087 from slavapestov/moar-test-coverage
Add a fixed crasher and an unfixed one
2 parents d05d57a + 945f6cf commit d834929

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: not --crash %target-swift-frontend %s -typecheck
2+
3+
protocol P {}
4+
5+
func bar(p: P?) {
6+
foo(p is String)
7+
}
8+
9+
func foo<T>(_: T, _: T) {}
10+
func foo<T>(_: T?, _: T?) {}
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-frontend %s -emit-ir
2+
3+
class IndexPath {
4+
init(indexes: [Int]) {}
5+
}
6+
7+
extension CountableRange where Bound == Int {
8+
func indexPaths(inSection section: Bound) -> [IndexPath] {
9+
return reduce([]) { $0 + [IndexPath(indexes: [section, $1])] }
10+
}
11+
}

0 commit comments

Comments
 (0)