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 @@ -249,6 +249,24 @@ static bool isTypeMetadataForLayoutAccessible(SILModule &M, SILType type) {
249249 if (type.is <AnyMetatypeType>())
250250 return true ;
251251
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 (
263+ M, SILType::getPrimitiveAddressType (eltType)))
264+ return false ;
265+ }
266+
267+ return true ;
268+ }
269+
252270 // Otherwise, check that we can fetch the type metadata.
253271 return M.isTypeMetadataAccessible (type.getASTType ());
254272}
You can’t perform that action at this time.
0 commit comments