Closed chtenb closed 1 week ago
@daanx This is due to the identifier tail
in -> repro/min-by-rec<a>(tail, ordering, default, (ordering(x)), x);
being parsed as the tail fip
keyword. In this line the try parseFip
parser succeeds while consuming input (due to the catch-all case of a tail but non-fip function) Then, the next line fails but the try keyword does not span that line. I would suggest moving the try
keyword to span both the parseFip
and the dockeyword "fun"
in the parser.
Actually this is now fixed on dev.
Great, I can confirm that this is fixed! There is another occurrence of try parseFip
in inlineDefSort
-- while there is currently no danger of this going wrong, I would recommend fixing that as well since confusingly try parseFip == parseFip
. Should I push a fix?
Let's avoid that change for now. Daan has changed some parsing on the branch dev-overload, and we should wait for that to be merged.
Really fixed now -- famous last words :-)
For some programs, loading the source code in the koka repl gives a strange error. Reloading it through
:r
does not give the compile error. Compiling as an executable also does not give the error. Happens indev
and latest release. Tested on windows 11.Reproduction
Save the following code as repro.kk:
Now run the following commands
koka repro
(no error)koka
:l repro
(error):l repro
(error):r
(no error)See my output at the bottom for reference.
Note the error message:
What strikes me as odd is that the line number does not exist in the original source, but seems to refer to a kki file. I've added the kki file at the bottom of the post.
Reproduction console output
repro.kki