Skip to content

Commit

Permalink
Fix 'tag' formal position for non-methods
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Sep 26, 2024
1 parent 2226aa5 commit 7e85854
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions frontend/lib/resolution/Resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4850,12 +4850,15 @@ bool Resolver::enter(const IndexableLoop* loop) {
auto& iterandRE = byPostorder.byAst(iterand);
auto& MSC = iterandRE.mostSpecific();
auto fn = MSC.only() ? MSC.only().fn() : nullptr;
const unsigned int tagPos = 1;
if (fn && fn->isIterator() &&
fn->numFormals() >= (tagPos + 1) &&
fn->formalType(tagPos).type() == EnumType::getIterKindType(context)) {
if (!loopRequiresParallel) {
m = IterDetails::ANY;
if (fn && fn->isIterator()) {
const unsigned int tagPos =
fn->isMethod() ? 1 : 0; // offset for 'this'
if (fn->numFormals() > tagPos &&
fn->formalType(tagPos).type() ==
EnumType::getIterKindType(context)) {
if (!loopRequiresParallel) {
m = IterDetails::ANY;
}
}
}
}
Expand Down

0 comments on commit 7e85854

Please sign in to comment.