Skip to content

Commit

Permalink
Also account for genericity via grandparent
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Sep 3, 2024
1 parent 67dda3e commit a5a8aab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/lib/resolution/InitResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ static const Type* ctFromSubs(Context* context,
auto oldBasic = cls->basicClassType();
CHPL_ASSERT(oldBasic && "Not handled!");

bool genericParent = superType && superType->substitutions().size() != 0;
bool genericParent =
superType && superType->instantiatedFromCompositeType() != nullptr;
auto instantiatedFrom = (subs.size() == 0 && !genericParent)
? nullptr
: root->toBasicClassType();
Expand Down Expand Up @@ -311,7 +312,8 @@ const Type* InitResolver::computeReceiverTypeConsideringState(void) {
DefaultsPolicy::USE_DEFAULTS);
CompositeType::SubstitutionsMap subs;

bool genericParent = superType_ && superType_->substitutions().size() != 0;
bool genericParent =
superType_ && superType_->instantiatedFromCompositeType() != nullptr;

if (!rfNoDefaults.isGeneric()) {
if (genericParent) {
Expand Down

0 comments on commit a5a8aab

Please sign in to comment.