Skip to content

Commit 608ff1b

Browse files
committed
Demangler: expand defaults in SILBoxType's sig.
1 parent 0f03136 commit 608ff1b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/AST/ASTDemangler.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,16 +842,22 @@ Type ASTBuilder::createSILBoxTypeWithLayout(
842842
ArrayRef<BuiltSubstitution> Substitutions,
843843
ArrayRef<BuiltRequirement> Requirements) {
844844
SmallVector<Type, 4> replacements;
845-
SmallVector<GenericTypeParamType *, 4> genericTypeParams;
845+
SmallVector<GenericTypeParamType *, 2> genericTypeParams;
846846
for (const auto &s : Substitutions) {
847847
if (auto *t = dyn_cast_or_null<GenericTypeParamType>(s.first.getPointer()))
848848
genericTypeParams.push_back(t);
849849
replacements.push_back(s.second);
850850
}
851851

852852
GenericSignature signature;
853-
if (!genericTypeParams.empty())
854-
signature = GenericSignature::get(genericTypeParams, Requirements);
853+
if (!genericTypeParams.empty()) {
854+
SmallVector<BuiltRequirement, 2> RequirementsVec(Requirements);
855+
signature = swift::buildGenericSignature(Ctx,
856+
signature,
857+
genericTypeParams,
858+
std::move(RequirementsVec),
859+
/*allowInverses=*/true);
860+
}
855861
SmallVector<SILField, 4> silFields;
856862
for (auto field: fields)
857863
silFields.emplace_back(field.getPointer()->getCanonicalType(),

0 commit comments

Comments
 (0)