koka-lang / koka

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

Anyother compiler error was encountered #275

Open BrendanMesters opened 2 years ago

BrendanMesters commented 2 years ago

I encountered another compiler error.

koka analysis-structure.kk  -e
compile: analysis-structure.kk
loading: std/core
loading: std/core/types
loading: std/core/hnd
loading: language-constructs
loading: error-warning-handler
compile: type-functional-effect.kk
loading: scope
check  : type-functional-effect
*** internal compiler error: Type.TypeVar.subFind: incompatible kind: 
 tvar: 1005:KCon V,
 type: TVar (TypeVar {typevarId = 1018, typevarKind = KCon E, typevarFlavour = Skolem}):KCon E

The code that produced this error can be found in This commit.

To get the error I tried to compile analysis-structure.kk, I assume the bug to appear due to the function interpreter_handler in type-functional-effects.kk

Good luck with the bug hunting :-)

daanx commented 2 years ago

Yikes -- that is not good; It is from the internal "core linter". Do you get this error with the latest dev branch? I just fixed a kinding error there a week ago.
I will try to get to it but it is a busy week; do you have a workaround? If you can build Koka yourself you can just comment out the assertion since often the code just works anyways.

jmanuel1 commented 1 year ago

I encountered a very similar error just recently. I built koka from the master branch and didn't get the error after a bit of testing.

TimWhiting commented 6 months ago

@BrendanMesters I just checked out that commit, and on the latest release of Koka I was not able to reproduce the error. @jmanuel1 have you seen this or been able to reproduce this recently? If not, maybe we can close this issue.

jmanuel1 commented 3 months ago

@TimWhiting I haven't used Koka in months, and I can tell a lot of work has been done 😆. But I will try to (remember how to) reproduce the bug again soon

BrendanMesters commented 1 month ago

@TimWhiting its also been a good while for me since I used Koka and have started my system from clean since, so I don't think that I'll be able to reproduce these errors anymore, given the fact that I don't really know what triggered the error.

I do know that it came about when I tried to layer many abstraction levels using the effect handelers (I was doing some research into wether effect handlers could abstract away some of the similar structural elements within compilers, interpreters, and some of the other tools within the compiler pipeline).

I hope that this info might be of help.