mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Workaround for GenericSignatureBuilder bug
The GSB will drop same-type requirements sometimes, when the right hand side is smaller than the left. Change the order when adding these requirements, which seems to work well enough for my reduced testcase. Also, ensure that everything works correctly with the RequirementMachine, which doesn't have the same underlying problems with same-type requirement handling. Fixes rdar://86431977.
This commit is contained in:
@@ -1649,8 +1649,8 @@ public:
|
||||
newGPMapping.insert({gp, newParamTy});
|
||||
auto substGPTy = Type(gp).subst(substGPMap)->castTo<GenericTypeParamType>();
|
||||
substRequirements.push_back(Requirement(RequirementKind::SameType,
|
||||
substGPTy,
|
||||
newParamTy));
|
||||
newParamTy,
|
||||
substGPTy));
|
||||
assert(!substReplacementTypes[substGPTy->getIndex()]);
|
||||
substReplacementTypes[substGPTy->getIndex()] = substParamTy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user