Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal compiler error using lambdas #5544

Closed
npadmana opened this issue Mar 7, 2017 · 1 comment · Fixed by #22100
Closed

Internal compiler error using lambdas #5544

npadmana opened this issue Mar 7, 2017 · 1 comment · Fixed by #22100

Comments

@npadmana
Copy link
Contributor

npadmana commented Mar 7, 2017

Summary of Problem

I'm running into an internal compiler error (CAL1184) trying to pass a lambda to a function.

Steps to Reproduce

Source Code:

proc times2(f) {
  return 2*f();
}

proc test(k : int) {
  var func = lambda() { return k;};
  writeln(times2(func));
}

test(2);

Compile command:
chpl buggy2.chpl

Compile output:

buggy2.chpl:1: In function 'times2':
buggy2.chpl:2: internal error: CAL1184 chpl Version 1.14.0.2a61e6e

Internal errors indicate a bug in the Chapel compiler ("It's us, not you"),
and we're sorry for the hassle.  We would appreciate your reporting this bug -- 
please see http://chapel.cray.com/bugs.html for instructions.  In the meantime,
the filename + line number above may be useful in working around the issue.
@cassella
Copy link
Contributor

@jabraham17 Now that you mention it (in #6538) the code here no longer hits an internal error, but instead reports the same sort of error as in the .good file there,

buggy2.chpl:5: In function 'test':
buggy2.chpl:6: error: cannot capture lambda because it refers to outer variables
buggy2.chpl:6: note: such as 'k', here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants