mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix unsafeGetSubstFieldType to propagate a substitution map in
whichever case it happens to be in. This is a basic fix so that parallel walks on tuples and function types in the substituted type will work . Separately, though, I do not think the places that use this really need to be passed an orig type; this is used for computing type properties, and I am not aware of any reason we should need an orig type to compute type properties. Additionally, the orig types computed by this function are not really correct because of the substitution being done in some cases, so it'd be very nice to rip this all out. I'm not good to look into that right now, though.
This commit is contained in:
@@ -1583,13 +1583,14 @@ bool AbstractionPattern::hasSameBasicTypeStructure(CanType l, CanType r) {
|
||||
|
||||
AbstractionPattern
|
||||
AbstractionPattern::unsafeGetSubstFieldType(ValueDecl *member,
|
||||
CanType origMemberInterfaceType)
|
||||
CanType origMemberInterfaceType,
|
||||
SubstitutionMap subMap)
|
||||
const {
|
||||
assert(origMemberInterfaceType);
|
||||
if (isTypeParameterOrOpaqueArchetype()) {
|
||||
// Fall back to the generic abstraction pattern for the member.
|
||||
auto sig = member->getDeclContext()->getGenericSignatureOfContext();
|
||||
return AbstractionPattern(sig.getCanonicalSignature(),
|
||||
return AbstractionPattern(subMap, sig.getCanonicalSignature(),
|
||||
origMemberInterfaceType);
|
||||
}
|
||||
|
||||
@@ -1626,7 +1627,9 @@ const {
|
||||
member, origMemberInterfaceType)
|
||||
->getReducedType(getGenericSignature());
|
||||
|
||||
return AbstractionPattern(getGenericSignature(), memberTy);
|
||||
return AbstractionPattern(getGenericSubstitutions(),
|
||||
getGenericSignature(),
|
||||
memberTy);
|
||||
}
|
||||
llvm_unreachable("invalid abstraction pattern kind");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user