File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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 (),
You can’t perform that action at this time.
0 commit comments