koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 151 forks source link

Error with final ctl operations #456

Closed TimWhiting closed 5 months ago

TimWhiting commented 5 months ago

Reported in #452

effect final ctl err-not-found(name: string): a

fun error-handler(eval: () -> <err-not-found|e> int): e string
  with final ctl err-not-found(name) "function not found: " ++ name
  eval().show
compiler threw exception: Type.Infer.checkCoverage: illegal operation field name: final ctl-err-not-found in issues/issuex/@Hnd-err-not-found
MrJohz commented 5 months ago

Would it be okay if I had a go at fixing it? It looks like the readOperationSort function here is missing a couple of cases (raw ctl and in this case final ctl), which in turn causes the checkCoverage function to fail.

It's late where I am right now, but I could look into it properly tomorrow at some point. If that's more trouble than it's worth, though, no worries!

TimWhiting commented 5 months ago

Don't worry, I can fix it. The issue is a bit more subtle than that. Leaving it with spaces would cause issues in other parts of the compilation (especially since the operation names are written to the core interface files, and would be parsed wrong from those files).

TimWhiting commented 5 months ago

@MrJohz thanks for the offer of contribution though! I'm excited to see more people interested in hacking on Koka and helping with it.