From 20053e5115504dd484caa159f488a98bbd4268ed Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 3 Oct 2024 16:47:30 -0700 Subject: [PATCH] Replace bugfix to Ahmad's code with a more reasonable version Signed-off-by: Danila Fedorin --- frontend/lib/resolution/Resolver.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/frontend/lib/resolution/Resolver.cpp b/frontend/lib/resolution/Resolver.cpp index e98b360d8df..618eda9c82f 100644 --- a/frontend/lib/resolution/Resolver.cpp +++ b/frontend/lib/resolution/Resolver.cpp @@ -2511,18 +2511,13 @@ QualifiedType Resolver::typeForId(const ID& id, bool localGenericToUnknown) { // that we are working with a nested method if (auto rt = methodReceiverType().type()) { // get the new class type if the receiver is a class - auto nct = rt->toClassType(); - // get the manager record using ClassType method managerRecordType() - if (auto mr = checkIfReceiverIsManagerRecord(context, nct, parentId)) { - ct = mr; - auto fieldName = parsing::fieldIdToName(context, id); - // TODO: shared has additional fields that are not generic - if (fieldName == "chpl_t" || fieldName == "chpl_p") { - auto intent = fieldName == "chpl_t" ? QualifiedType::TYPE : QualifiedType::VAR; - auto borrowed = nct->withDecorator(context, nct->decorator().toBorrowed()); - return QualifiedType(intent, borrowed); + if (auto ct = rt->toClassType()) { + if (auto mr = ct->managerRecordType(context)) { + rt = mr; } - } else if (auto comprt = rt->getCompositeType()) { + } + + if (auto comprt = rt->getCompositeType()) { if (comprt->id() == parentId) { ct = comprt; // handle record, class with field } else if (auto bct = comprt->toBasicClassType()) {