Skip to content

Commit

Permalink
Only keep eltType in generic-domain arr if resolved
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Feb 5, 2025
1 parent 2c98242 commit bfc24ed
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions frontend/lib/resolution/Resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6275,14 +6275,17 @@ static bool handleArrayTypeExpr(Resolver& rv,
// Assemble the array type
auto arrayType = genericArrayType;
if (domainType.type() == DomainType::getGenericDomainType(rv.context)) {
auto domainTypeAsType =
QualifiedType(QualifiedType::TYPE, domainType.type());
arrayType =
QualifiedType(QualifiedType::TYPE,
ArrayType::getArrayType(rv.context,
/* instance */ QualifiedType(),
/* domainType */ domainTypeAsType,
/* eltType */ eltType));
// Preserve eltType info, if we have it.
if (!eltType.isUnknownOrErroneous()) {
auto domainTypeAsType =
QualifiedType(QualifiedType::TYPE, domainType.type());
arrayType = QualifiedType(
QualifiedType::TYPE,
ArrayType::getArrayType(rv.context,
/* instance */ QualifiedType(),
/* domainType */ domainTypeAsType,
/* eltType */ eltType));
}
} else {
// We have an instantiated domain, so get array type via call to its
// array builder function.
Expand Down

0 comments on commit bfc24ed

Please sign in to comment.