mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Generic signature builder] Concrete constraints across equivalence classes.
When emitting a requirement for a same-type-to-concrete constraint, use the known concrete source for just the first of the component anchors. For the rest, we need to explicitly model the constraint lest it get lost. Fixes rdar://problem/30478915.
This commit is contained in:
@@ -2340,12 +2340,6 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
|
||||
if (archetype->isInvalid())
|
||||
return true;
|
||||
|
||||
// If there is a concrete type above us, there are no requirements to
|
||||
// emit.
|
||||
if (archetype->getParent() &&
|
||||
hasConcreteTypeInPath(archetype->getParent()))
|
||||
return true;
|
||||
|
||||
// Keep it.
|
||||
return false;
|
||||
}),
|
||||
@@ -2388,7 +2382,9 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
|
||||
// anchor with a concrete type.
|
||||
if (auto concreteType = rep->getConcreteType()) {
|
||||
f(RequirementKind::SameType, archetype, concreteType,
|
||||
rep->getConcreteTypeSource());
|
||||
knownAnchor == componentAnchors.begin()
|
||||
? rep->getConcreteTypeSource()
|
||||
: RequirementSource(RequirementSource::Explicit, SourceLoc()));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user