Files
swift-mirror/test/Generics/sr5726.swift
Doug Gregor bd266b0520 [GSB] Introduce type-rewriting rules only when we merge equivalence classes.
Instead of representing every same-type constraint we see as a rewrite rule,
only record rewrite rules when we merge equivalence classes, and record
rules that map the between the anchors of the equivalence classes. This
gives us fewer, smaller rewrite rules that (by construction) build correct
anchors.
2018-02-16 15:09:58 -08:00

17 lines
330 B
Swift

// RUN: %target-typecheck-verify-swift
// SR-5726
protocol Foo
{
associatedtype Bar
var bar: Bar { get }
}
extension Foo where Self: Collection, Bar: Collection, Self.SubSequence == Bar.SubSequence, /*redundant: */Self.Index == Bar.Index
{
subscript(_ bounds: Range<Index>) -> SubSequence
{
return bar[bounds]
}
}