File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -6054,6 +6054,8 @@ class PackArchetypeType final
6054
6054
return T->getKind () == TypeKind::PackArchetype;
6055
6055
}
6056
6056
6057
+ CanTypeWrapper<PackType> getSingletonPackType ();
6058
+
6057
6059
private:
6058
6060
PackArchetypeType (const ASTContext &Ctx, GenericEnvironment *GenericEnv,
6059
6061
Type InterfaceType, ArrayRef<ProtocolDecl *> ConformsTo,
Original file line number Diff line number Diff line change @@ -418,4 +418,11 @@ PackType *PackType::get(const ASTContext &C,
418
418
}
419
419
420
420
return get (C, wrappedArgs)->flattenPackTypes ();
421
- }
421
+ }
422
+
423
+
424
+ CanPackType PackArchetypeType::getSingletonPackType () {
425
+ SmallVector<Type, 1 > types;
426
+ types.push_back (PackExpansionType::get (this , getReducedShape ()));
427
+ return CanPackType (PackType::get (getASTContext (), types));
428
+ }
Original file line number Diff line number Diff line change @@ -2215,15 +2215,12 @@ const TypeInfo *TypeConverter::convertType(CanType ty) {
2215
2215
case TypeKind::Pack:
2216
2216
return convertPackType (cast<PackType>(ty));
2217
2217
case TypeKind::PackArchetype: {
2218
- // FIXME: This is the wrong place for this kind of wrapping
2219
- SmallVector<Type> elts;
2220
2218
auto archetypeTy = cast<PackArchetypeType>(ty);
2221
- elts.push_back (PackExpansionType::get (archetypeTy,
2222
- archetypeTy->getReducedShape ()));
2223
- return convertPackType (PackType::get (IGM.Context , elts));
2219
+ return convertPackType (archetypeTy->getSingletonPackType ());
2224
2220
}
2225
2221
case TypeKind::PackExpansion: {
2226
- // FIXME: This is the wrong place for this kind of wrapping
2222
+ // FIXME: SIL shouldn't emit values with pack expansion type; they
2223
+ // should always be wrapped in a PackType or be a bare PackArchetypeType
2227
2224
SmallVector<Type> elts;
2228
2225
elts.push_back (ty);
2229
2226
return convertPackType (PackType::get (IGM.Context , elts));
You can’t perform that action at this time.
0 commit comments