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 error using first class functions in map #18736

Open
bmcdonald3 opened this issue Nov 16, 2021 · 1 comment
Open

Internal error using first class functions in map #18736

bmcdonald3 opened this issue Nov 16, 2021 · 1 comment

Comments

@bmcdonald3
Copy link
Member

Summary

When the type of a FCF is used to construct a map and then that function is added to the map it will cause an internal error. If you declare a function, use its type to construct the map, and then pass a different function, that works as expected.

This causes an internal error:

use Map;
proc myF() {
  return 1;
}
var m: map(string, myF.type);
m.add("asd", myF);

This does not:

use Map;
proc myF() {
  return 1;
}

proc myF2() {
  return 2;
}

var m: map(string, myF.type);
m.add("asd", myF2);
@bradcray
Copy link
Member

Compiling this test with --verify flags an error:

testit.chpl:1: In module 'testit':
testit.chpl:6: internal error: SymExpr::verify      1336588:  var->defPoint is not in AST [AST/expr.cpp:572]

suggesting to me that we're probably referring to something after pulling it out of the AST. However, recompiling with --no-dead-code-elimination doesn't help, so something else must be going on... I'm probably going to time out on this before coming to any conclusion, but wanted to note this observation first.

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

No branches or pull requests

3 participants