mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Use SubstitutionMap, not SubstitutionList, in SILBoxType.
Eliminate the last place in the AST proper that stores SubstitutionLists rather than SubstitutionMaps. Randomly fixes a crasher, too.
This commit is contained in:
@@ -3847,17 +3847,8 @@ void Serializer::writeType(Type ty) {
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[SILBoxTypeLayout::Code];
|
||||
SILLayoutID layoutRef = addSILLayoutRef(boxTy->getLayout());
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (auto sig = boxTy->getLayout()->getGenericSignature()) {
|
||||
assert(sig->getSubstitutionListSize()
|
||||
== boxTy->getGenericArgs().size());
|
||||
}
|
||||
#endif
|
||||
|
||||
SILBoxTypeLayout::emitRecord(Out, ScratchRecord, abbrCode, layoutRef);
|
||||
|
||||
// Write the set of substitutions.
|
||||
writeSubstitutions(boxTy->getGenericArgs(), DeclTypeAbbrCodes);
|
||||
SILBoxTypeLayout::emitRecord(Out, ScratchRecord, abbrCode, layoutRef,
|
||||
addSubstitutionMapRef(boxTy->getSubstitutions()));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user