Skip to content

Commit 227a6df

Browse files
committed
Add regression tests
1 parent 9157d98 commit 227a6df

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-frontend -emit-ir -g %s
2+
3+
protocol Foo {
4+
associatedtype ErrorType: Error
5+
}
6+
7+
extension Array: Error where Element: Error {}
8+
9+
class Bar<A: Foo> {
10+
func doSomething(with result: Result<Any, [A.ErrorType]>) {}
11+
}
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+
public final class TypedNode {
4+
public var property: String?
5+
6+
public func withProperty(_ generator: (Self) -> String) -> Self {
7+
self.property = generator(self)
8+
return self
9+
}
10+
}
11+
12+
let tree = TypedNode().withProperty { "\($0)" }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
struct A<X> {}
4+
extension A<A<Int>.B> {
5+
struct B {}
6+
}

0 commit comments

Comments
 (0)