Both the pre-release and 1.25 compilers get internal errors with the code below. (The error for 1.25.0 ends in -0921)
I don't know if I'm blocked, yet, When I was working to reduce it to a minimal test case, I saw some sensitivity that
suggested possible workarounds.
Steps to Reproduce
Source Code: spam.chpl
module Spam {
use BlockDist;
use CPtr;
type region_desc = c_ptr(void);
class sam {
proc lookup_region(regionName:string): region_desc throws {
return c_nil;
}
}
var sammy = new sam();
private proc regionLookups(ref regionDescs, regionName: string) throws {
// Won't break if the try isn't there.
try {
// The "with in" seems to be required as well
forall r in regionDescs with (in regionName) {
r = sammy.lookup_region(regionName);
}
}
}
private proc lookup(regionName: string) throws {
var regionDescs = newBlockArr(0..#numLocales, region_desc);
regionLookups(regionDescs, regionName);
}
proc main() : int {
try! lookup("a");
return 0;
}
}
Compile command:
chpl -o ~/spam ~/spam.chpl
Execution command:
Associated Future Test(s):
Configuration Information
Output of chpl --version:
chpl version 1.26.0 pre-release (b3897ad689)
built with LLVM version 11.0.1
Back-end compiler and version, e.g. gcc --version or clang --version:
clang version 11.0.1 (git@github.com:chapel-lang/chapel.git b3897ad6899d6758574658bc5573d3ef16e3d24d)
Target: x86_64-unknown-linux-gnu
Thread model: posix