mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The new approach is to not look at RequirementSources at all. Instead, we exhaustively enumerate all conformance access paths, beginning from the root conformance requirements in the signature, then doing all conformance requirements from those protocols' requirement signatures, and so on. We enumerate conformance access paths in breadth first order by length until we find the one we want. The results are memoized. This fixes a regression with another change I'm working on. The test case does not fail with this PR alone, but I'm adding it now anyway.
22 lines
689 B
Swift
22 lines
689 B
Swift
// RUN: %target-swift-frontend -typecheck -debug-generic-signatures %s 2>&1 | %FileCheck %s
|
|
// RUN: %target-swift-frontend -emit-ir -verify %s
|
|
|
|
// Reduced from swift-futures project in the source compatibility suite.
|
|
|
|
public protocol FutureProtocol: FutureConvertible where FutureType == Self {
|
|
associatedtype Output
|
|
}
|
|
|
|
public protocol FutureConvertible {
|
|
associatedtype FutureType: FutureProtocol
|
|
}
|
|
|
|
func takesFuture<T : FutureProtocol>(_: T.Type) {}
|
|
|
|
public struct FutureHolder<T : FutureProtocol> {
|
|
// CHECK-LABEL: Generic signature: <T, U where T == U.FutureType, U : FutureConvertible>
|
|
init<U : FutureConvertible>(_: U) where U.FutureType == T {
|
|
takesFuture(T.self)
|
|
}
|
|
}
|