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