Skip to content

Add validation test for fixed crasher #20627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions validation-test/compiler_crashers_2_fixed/0182-rdar45680857.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// RUN: %target-swift-frontend -emit-ir %s

public protocol Graph: class, Collection {
associatedtype V
associatedtype E
}

public protocol EdgeContainer {
associatedtype E
associatedtype Visitor: NeighboursVisitor where Visitor.C == Self

func push(_ thing: E)
}

public protocol NeighboursVisitor {
associatedtype C: EdgeContainer
associatedtype G: Graph where G.E == C.E
}

public enum LIFONeighboursVisitor<C: EdgeContainer, G: Graph>: NeighboursVisitor where G.E == C.E {

}

public class Stack<T, G: Graph>: EdgeContainer where T == G.E {
public typealias E = T
public typealias Visitor = LIFONeighboursVisitor<Stack<T, G>, G>

public func push(_ thing: T) { }
}