Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Compiler cannot resolve parallel iterator with qualified import #26362

Open
jabraham17 opened this issue Dec 4, 2024 · 3 comments
Open

Comments

@jabraham17
Copy link
Member

jabraham17 commented Dec 4, 2024

The following program fails to resolve on main

module A {
  iter foo(): int {}
  iter foo(param tag): int where tag == iterKind.standalone {}
}
module B {
  proc main() {
    import A;
    forall i in A.foo() {}
  }
}
simple.chpl:9: In function 'main':
simple.chpl:11: error: A standalone or leader iterator is not found for the iterable expression in this forall loop

The problem is that the qualified import, import A, does not bring in enough information for the resolver to resolve A.foo to the parallel iterator. Changing import to use in the above program does work.

I am filing this bug because it is a bug, but I have confirmed that the new dyno resolver already handles this correctly, so I expect the way this bug will be handled is by having the dyno resolver takeover production (unless there is an easy fix in the current resolver)

Associated future: test/functions/iterators/qualifiedParallelImport.chpl

@bradcray
Copy link
Member

bradcray commented Dec 4, 2024

Since @DanilaFe was working on resolving iterators in Dyno recently (albeit in a different context, IIRC), I'm curious whether Dyno inherits this behavior or maybe improves upon it?

@jabraham17
Copy link
Member Author

jabraham17 commented Dec 4, 2024

Dyno fixes this. Running testInteractive --std on the test case resolves properly, regardless of use/import

@bradcray
Copy link
Member

bradcray commented Dec 4, 2024

Dyno's so great! 🎉

jabraham17 added a commit that referenced this issue Dec 4, 2024
Add a future test for #26362

[Trivial - not reviewed]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants