Open jabraham17 opened 1 month ago
In working on PR #25878 I noticed this case also fails with an internal error (which I am supposing is similar). The difference is that this one could plausibly work.
record R1 {
proc foo() { return 1; }
}
record R2 {
proc foo() { return 2; }
}
record Wrapper {
var r1: R1;
forwarding something;
}
proc Wrapper.something { return r1; }
proc something { return new R2(); } // production: compiler crash unless this is commented out
var x:Wrapper;
writeln(x.foo());
That PR adds this as a future forwarding-to-method-and-non-method.chpl
that refers to this issue.
Summary of Problem
Description:
Attempting to incorrectly use
forwarding
on a module-scoped variable or expression results in an internal error. This should just be an error message thatforwarding
does not work at module scope.Is this issue currently blocking your progress? no
Steps to Reproduce
Source Code:
Configuration Information
chpl --version
: 2.2 prerelease$CHPL_HOME/util/printchplenv --anonymize
: CHPL_TARGET_PLATFORM: darwin CHPL_TARGET_COMPILER: llvm CHPL_TARGET_ARCH: arm64 CHPL_TARGET_CPU: native CHPL_LOCALE_MODEL: flat CHPL_COMM: none CHPL_TASKS: qthreads CHPL_LAUNCHER: none CHPL_TIMERS: generic CHPL_UNWIND: none CHPL_MEM: jemalloc CHPL_ATOMICS: cstdlib CHPL_GMP: system CHPL_HWLOC: system CHPL_RE2: bundled * CHPL_LLVM: system CHPL_AUX_FILESYS: nonegcc --version
orclang --version
: LLVM 18