Skip to content

Commit c29ae74

Browse files
committed
Add validation test for fixed crasher
1 parent 1673c12 commit c29ae74

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
public protocol Graph: class, Collection {
4+
associatedtype V
5+
associatedtype E
6+
}
7+
8+
public protocol EdgeContainer {
9+
associatedtype E
10+
associatedtype Visitor: NeighboursVisitor where Visitor.C == Self
11+
12+
func push(_ thing: E)
13+
}
14+
15+
public protocol NeighboursVisitor {
16+
associatedtype C: EdgeContainer
17+
associatedtype G: Graph where G.E == C.E
18+
}
19+
20+
public enum LIFONeighboursVisitor<C: EdgeContainer, G: Graph>: NeighboursVisitor where G.E == C.E {
21+
22+
}
23+
24+
public class Stack<T, G: Graph>: EdgeContainer where T == G.E {
25+
public typealias E = T
26+
public typealias Visitor = LIFONeighboursVisitor<Stack<T, G>, G>
27+
28+
public func push(_ thing: T) { }
29+
}

0 commit comments

Comments
 (0)