mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
17 lines
330 B
Swift
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]
|
|
}
|
|
}
|