Initializing a task-local variable using a throwing function results in an internal error.
Related issues:
Source Code:
/* Defining task-local variable with throwing function gives internal error */
var curTaskID: atomic int;
proc getTaskID() throws { // <-- removing throws allows program to compile
return curTaskID.fetchAdd(1);
}
var dom = {1..100};
forall i in dom with (const taskID = getTaskID()) {
writeln(i, ' : ', taskID);
}
Compile command:
> chpl repro.chpl
repro.chpl:11: internal error: number of actuals (0) does not match number of formals (1) in getTaskID() [resolution/lateConstCheck.cpp:139]
chpl --version: chpl version 1.21.0 pre-release (715585b29c)I agree that this looks like the same issue as #13203, though I think it's better described / distilled here. It looks like I never convinced @vasslitvinov to look at it there, so I'll try again here. :)
[I'm throwing a user error tag onto this since it was originally reported by a user even though Ben isn't one].
This program compiles and runs with today's master, chpl version 1.21.0 pre-release (713f993)
Err, duh. I hadn't refreshed the page, so didn't see the issue was Closed. Never mind.
Wow, that's a long time to have a tab open, Paul! :D