Files
swift-mirror/test/SIL/Parser/where_clause.sil
Doug Gregor f7f703ad04 [Archetype builder] Canonicalize and minimize same-type constraints.
Introduce an algorithm to canonicalize and minimize same-type
constraints. The algorithm itself computes the equivalence classes
that would exist if all explicitly-provided same-type constraints are
ignored, and then forms a minimal, canonical set of explicit same-type
constraints to reform the actual equivalence class known to the type
checker. This should eliminate a number of problems we've seen with
inconsistently-chosen same-type constraints affecting
canonicalization.
2017-02-01 10:51:02 -08:00

18 lines
498 B
Plaintext

// RUN: %target-swift-frontend %s -emit-silgen | %FileCheck %s
// rdar://16238241
// Make sure we can parse where clause with conformance & same-type requirements.
protocol Runcible {
associatedtype Mince
associatedtype Quince
}
struct Spoon<T: Runcible> {}
// CHECK: sil @foo : $@convention(thin) <T where T : Runcible, T == T.Mince> () -> @out Spoon<T>
sil @foo : $@convention(thin) <T where T: Runcible, T == T.Mince> () -> @out Spoon<T> {
entry(%0 : $*Spoon<T>):
return undef : $()
}