File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,24 @@ static bool isTypeMetadataForLayoutAccessible(SILModule &M, SILType type) {
256
256
if (type.is <AnyMetatypeType>())
257
257
return true ;
258
258
259
+ // - pack expansion types
260
+ if (auto expansionType = type.getAs <PackExpansionType>()) {
261
+ auto patternType = SILType::getPrimitiveType (expansionType.getPatternType (),
262
+ type.getCategory ());
263
+ return isTypeMetadataForLayoutAccessible (M, patternType);
264
+ }
265
+
266
+ // - lowered pack types
267
+ if (auto packType = type.getAs <SILPackType>()) {
268
+ for (auto eltType : packType.getElementTypes ()) {
269
+ if (!isTypeMetadataForLayoutAccessible (
270
+ M, SILType::getPrimitiveAddressType (eltType)))
271
+ return false ;
272
+ }
273
+
274
+ return true ;
275
+ }
276
+
259
277
// Otherwise, check that we can fetch the type metadata.
260
278
return M.isTypeMetadataAccessible (type.getASTType ());
261
279
}
You can’t perform that action at this time.
0 commit comments