@@ -4056,9 +4056,15 @@ void SILBoxType::Profile(llvm::FoldingSetNodeID &id, SILLayout *Layout,
4056
4056
Substitutions.profile (id);
4057
4057
}
4058
4058
4059
- static RecursiveTypeProperties getRecursivePropertiesOfMap (
4060
- SubstitutionMap subMap) {
4059
+ static RecursiveTypeProperties getBoxRecursiveProperties (
4060
+ SILLayout *Layout, SubstitutionMap subMap) {
4061
4061
RecursiveTypeProperties props;
4062
+ for (auto &field : Layout->getFields ()) {
4063
+ auto fieldProps = field.getLoweredType ()->getRecursiveProperties ();
4064
+ fieldProps.removeHasTypeParameter ();
4065
+ fieldProps.removeHasDependentMember ();
4066
+ props |= fieldProps;
4067
+ }
4062
4068
for (auto replacementType : subMap.getReplacementTypes ()) {
4063
4069
if (replacementType) props |= replacementType->getRecursiveProperties ();
4064
4070
}
@@ -4067,7 +4073,8 @@ static RecursiveTypeProperties getRecursivePropertiesOfMap(
4067
4073
4068
4074
SILBoxType::SILBoxType (ASTContext &C,
4069
4075
SILLayout *Layout, SubstitutionMap Substitutions)
4070
- : TypeBase(TypeKind::SILBox, &C, getRecursivePropertiesOfMap(Substitutions)),
4076
+ : TypeBase(TypeKind::SILBox, &C,
4077
+ getBoxRecursiveProperties (Layout, Substitutions)),
4071
4078
Layout(Layout), Substitutions(Substitutions) {
4072
4079
assert (Substitutions.isCanonical ());
4073
4080
}
0 commit comments