mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When two associated types with the same name are on the same dependent type T, introduce a same-type constraint between the the corresponding potential archetypes. This eliminates ordering dependencies in the archetype builder. Fixes the reduced test case from rdar://problem/23149063, but doesn't fully address the idea that we should be tracking associated type redeclarations in a meaningful way.
15 lines
362 B
Swift
15 lines
362 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// rdar://problem/23149063
|
|
protocol P0 { }
|
|
|
|
protocol P {
|
|
associatedtype A
|
|
}
|
|
|
|
protocol Q : P {
|
|
associatedtype A
|
|
}
|
|
|
|
func f<T>(t: T) where T : P, T : Q, T.A : P0 { } // expected-note{{'f(t:)' previously declared here}}
|
|
func f<T>(t: T) where T : Q, T : P, T.A : P0 { } // expected-error{{invalid redeclaration of 'f(t:)'}} |