Skip to content

Commit

Permalink
Replace bugfix to Ahmad's code with a more reasonable version
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Fedorin <[email protected]>
  • Loading branch information
DanilaFe committed Oct 4, 2024
1 parent b6bf5be commit 20053e5
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions frontend/lib/resolution/Resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 20053e5

Please sign in to comment.