Skip to content

Commit f5eb708

Browse files
committed
Add a couple of regression tests
1 parent 71c11b7 commit f5eb708

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: not %target-swift-frontend -emit-ir %s
2+
3+
protocol P {
4+
associatedtype A: Q where A.B == Self
5+
}
6+
7+
protocol Q {
8+
associatedtype B: P where B.A == Self
9+
}
10+
11+
struct S1<T>: P where T: Q { }
12+
13+
struct S2: Q {
14+
typealias B = S1<S2>
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
@discardableResult public func applyWrapped<T, U>(function: Optional<(T) -> U>, to value: Optional<T>) -> Optional<U> {
4+
switch (function, value) {
5+
case (let .some(f), let .some(v)):
6+
return .some(f(v))
7+
case (.none, _):
8+
return .none
9+
case (_, .none):
10+
return .none
11+
}
12+
}

0 commit comments

Comments
 (0)