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