Skip to content

Commit 504d4f5

Browse files
committed
Add two passing regression tests and a failing one
1 parent afa08f0 commit 504d4f5

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: not --crash %target-swift-frontend -emit-ir %s
2+
3+
public protocol Prot {
4+
associatedtype T
5+
}
6+
7+
public class C<P: Prot> where P.T: Hashable {
8+
}
9+
10+
public class Spam<P: Prot> where P.T == Int {
11+
public func m(_ f: (C<P>) -> C<P>) {
12+
}
13+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
public protocol LinkedListNode: AnyObject {
4+
associatedtype T
5+
}
6+
7+
public class LinkedList<N: LinkedListNode> where N.T: Hashable {
8+
public typealias T = N.T
9+
}
10+
11+
public struct LinkedListIterator<N: LinkedListNode>: IteratorProtocol {
12+
public mutating func next() -> N.T? {
13+
return nil
14+
}
15+
}
16+
17+
extension LinkedList: Sequence {
18+
public typealias Element = T
19+
public typealias Iterator = LinkedListIterator<N>
20+
public __consuming func makeIterator() -> Iterator {
21+
fatalError()
22+
}
23+
}
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 %s
2+
// REQUIRES: OS=macosx
3+
4+
import Combine
5+
6+
@available(macOS 10.15, *)
7+
extension Publishers.Share {
8+
func foo<A: Publisher, B: Publisher>() where Upstream == Publishers.FlatMap<A, B>, B.Output == UInt8 {
9+
10+
}
11+
}

0 commit comments

Comments
 (0)