Chapel: Initializing a task-local variable using a throwing function results in an internal error

Created on 4 Nov 2019  路  4Comments  路  Source: chapel-lang/chapel

Summary of Problem

Initializing a task-local variable using a throwing function results in an internal error.

Related issues:

Steps to Reproduce

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]

Configuration Information

  • Output of chpl --version: chpl version 1.21.0 pre-release (715585b29c)
Compiler Bug user issue

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings