rascal
rascal copied to clipboard
Missing TypePal calculator for closures with patterns as parameters?
Describe the bug
I will make this example simpler later, but have to store it now to keep concentrating:
for (<p, lc, c, w1, w2> <- sort(shorterLitPrefixLex, bool (<int of1, _, _, _, _>, <int of2, _, _, _, _>) { return of1 < of2; })) {
tr(() {
th(scope("row"), "<p>");
td("<symbol2rascal(c)>");
td("<symbol2rascal(lc)>");
td("\'<w1>\' vs. \'<w2>\'");
});
}
This triggers the following exception in the rascal compiler:
[ERROR] Failed to execute goal org.rascalmpl:rascal-maven-plugin:0.16.0:compile (flybytes-compile) on project drambiguity: unexpected error during Rascal compiler run: |lib://typepal/analysis/typepal/Solver.rsc|:300,61: TypePalUsage(
[ERROR] "Missing calculators",
[ERROR] [
[ERROR] |file:///Users/jurgenv/git/drambiguity/src/Diagnose.rsc|(9993,18,<323,67>,<323,85>),
[ERROR] |file:///Users/jurgenv/git/drambiguity/src/Diagnose.rsc|(10013,18,<323,87>,<323,105>),
[ERROR] |file:///Users/jurgenv/git/drambiguity/src/Diagnose.rsc|(7882,15,<254,68>,<254,83>),
[ERROR] |file:///Users/jurgenv/git/drambiguity/src/Diagnose.rsc|(7865,15,<254,51>,<254,66>),
[ERROR] |file:///Users/jurgenv/git/drambiguity/src/Diagnose.rsc|(11883,21,<377,68>,<377,89>),
[ERROR] |file:///Users/jurgenv/git/drambiguity/src/Diagnose.rsc|(11906,21,<377,91>,<377,112>)
[ERROR] ])
[ERROR] -> [Help 1]
At line 323, 254 and 377 it is the same code template again and again with different width's of tuple matchers.
@PaulKlint is this perhaps one of those fixes for in-between waiting for bootstrap run?
Simpler example:
myList = [<1,2>,<2,2>];
sort(myList, bool (<int i, _>, <int j, _>) { return i < j; })
Thanks for the report. Indeed a glitch the code handling closures. Fixed now.