Branch: refs/heads/main
Revision: 65c0c9d89d93a57c51fa4310ba83e36244942fb7
Author: DanilaFe
Link: Dyno: fix enumToOrder for enums declared in internal modules by DanilaFe · Pull Request #27583 · chapel-lang/chapel · GitHub
Log Message:
Dyno: fix enumToOrder for enums declared in internal modules (#27583)
Closes https://github.com/Cray/chapel-private/issues/7402.
The following code now resolves fine in --dyno-resolve-only:
proc main() {
var m = memoryOrder.seqCst;
writeln(chpl__enumToOrder(m));
}
The issue was that internal modules don't auto-use ChapelBase.
As a result, they don't have access to ==. In production this doesn't
come up because chpl__enumToOrder gets placed into ChapelBase (?!).
In Dyno, we can't do this. Instead, this PR inserts a use statement
into chpl__enumToOrder to simulate having access to the necessary
methods etc.
Testing
- dyno tests
- code in this PR's OP / issue 7402 now resolves
- paratest
--dyno-resolve-only - paratest
Reviewed by @benharsh -- thanks!
Diff:
M frontend/lib/resolution/default-functions.cpp
M frontend/test/resolution/testEnums.cpp
https://github.com/chapel-lang/chapel/pull/27583.diff