New Issue: [Bug]: Circular 'public' imports cause duplicate candidates in qualified calls

28626, "DanilaFe", "[Bug]: Circular 'public' imports cause duplicate candidates in qualified calls", "2026-03-31T22:58:37Z"

module A {
  public use B;
  proc foo() {

  }
}
module B {
  public use A;
}
module C {
  import B;

  proc main() {
    B.foo();
  }
}

This fails to resolve because the candidate foo is found many times.

tmpdebug.chpl:13: In function 'main':
tmpdebug.chpl:14: error: ambiguous call 'B.foo()'
tmpdebug.chpl:3: note: candidates are: foo() [397059]
tmpdebug.chpl:3: note:                 foo() [397059]
tmpdebug.chpl:14: note: unresolved call had id 397082

Note that this doesn't cause problems if B is used, instead of doing a qualified call:

 module C {
-  import B; 
+  use B; 

   proc main() {
-    B.foo();
+    foo();
   }
 }