diff --git a/frontend/lib/resolution/Resolver.cpp b/frontend/lib/resolution/Resolver.cpp index 0738ccf2f3ed..d750070f1069 100644 --- a/frontend/lib/resolution/Resolver.cpp +++ b/frontend/lib/resolution/Resolver.cpp @@ -2285,7 +2285,7 @@ bool Resolver::resolveSpecialKeywordCall(const Call* call) { CHPL_ASSERT(!questionArg); // TODO: prohibit associative domain with idxType 'domain' auto ci = - CallInfo(USTR("init"), + CallInfo(UniqueString::get(context, "_domain"), rCalledExp.type(), /* isMethodCall */ false, /* hasQuestionArg */ false, diff --git a/frontend/lib/resolution/resolution-queries.cpp b/frontend/lib/resolution/resolution-queries.cpp index fd3b02979eba..3e843858cd65 100644 --- a/frontend/lib/resolution/resolution-queries.cpp +++ b/frontend/lib/resolution/resolution-queries.cpp @@ -1297,6 +1297,8 @@ typeConstructorInitialQuery(Context* context, const Type* t) idTag = uast::asttags::Class; } else if (t->isRecordType()) { idTag = uast::asttags::Record; + } else if (t->isDomainType()) { + idTag = uast::asttags::Record; } else if (t->isUnionType()) { idTag = uast::asttags::Union; } @@ -3463,22 +3465,22 @@ static bool resolveFnCallSpecialType(Context* context, // // TODO: sync, single if (ci.name() == "domain") { - // TODO: a compiler-generated type constructor would be simpler, but we - // don't support default values on compiler-generated methods because the - // default values require existing AST. - - // Note: 'dmapped' is treated like a binary operator at the moment, so - // we don't need to worry about distribution type for 'domain(...)' exprs. - - // Transform domain type expressions like `domain(arg1, ...)` into: - // _domain.static_type(arg1, ...) - auto genericDom = DomainType::getGenericDomainType(context); - auto recv = QualifiedType(QualifiedType::TYPE, genericDom); - auto typeCtorName = UniqueString::get(context, "static_type"); - auto ctorCall = CallInfo::createWithReceiver(ci, recv, typeCtorName); - - result = resolveCall(context, call, ctorCall, inScopes); - return true; + // // TODO: a compiler-generated type constructor would be simpler, but we + // // don't support default values on compiler-generated methods because the + // // default values require existing AST. + + // // Note: 'dmapped' is treated like a binary operator at the moment, so + // // we don't need to worry about distribution type for 'domain(...)' exprs. + + // // Transform domain type expressions like `domain(arg1, ...)` into: + // // _domain.static_type(arg1, ...) + // auto genericDom = DomainType::getGenericDomainType(context); + // auto recv = QualifiedType(QualifiedType::TYPE, genericDom); + // auto typeCtorName = UniqueString::get(context, "static_type"); + // auto ctorCall = CallInfo::createWithReceiver(ci, recv, typeCtorName); + + // result = resolveCall(context, call, ctorCall, inScopes); + // return true; } else if (ci.name() == "atomic") { auto newName = UniqueString::get(context, "chpl__atomicType"); auto ctorCall = CallInfo::copyAndRename(ci, newName); @@ -4275,6 +4277,7 @@ CallResolutionResult resolveFnCall(Context* context, ci.isMethodCall() == false) { // handle invocation of a type constructor from a type // (note that we might have the type through a type alias) + if (ci.name() == "domain" || ci.name() == "_domain") gdbShouldBreakHere(); mostSpecific = resolveFnCallForTypeCtor(context, ci, inScopes.callScope(), inScopes.poiScope(), diff --git a/frontend/lib/types/Type.cpp b/frontend/lib/types/Type.cpp index 712c9a1a3777..0fbf6940659e 100644 --- a/frontend/lib/types/Type.cpp +++ b/frontend/lib/types/Type.cpp @@ -128,6 +128,7 @@ void Type::gatherBuiltins(Context* context, gatherType(context, map, "Error", CompositeType::getErrorType(context)); gatherType(context, map, "domain", DomainType::getGenericDomainType(context)); + gatherType(context, map, "_domain", DomainType::getGenericDomainType(context)); gatherType(context, map, "class", AnyClassType::get(context)); auto genericBorrowed = ClassType::get(context, AnyClassType::get(context), nullptr, ClassTypeDecorator(ClassTypeDecorator::BORROWED));