koka-lang / koka

Koka language compiler and interpreter

Home Page:http://koka-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internal error when using recursive effect

hflsmax opened this issue · comments

The following program, when compiled with koka 3.1.1, produces an internal error

rec effect process
  fun yield(): ()
  fun fork(p: () -> <process> ()): ()
> koka -O3 -v0 -o main main.kk
main(1, 1): internal error: label has not kind X: (TCon (TypeCon {typeconName = main/process, typeconKind = KApp (KApp (KCon (->)) (KCon E)) (KApp (KApp (KCon (->)) (KCon V)) (KCon V))}),TCon (TypeCon {typeconName = std/core/types/total, typeconKind = KCon E}))
CallStack (from HasCallStack):
  error, called at src/Common/Failure.hs:46:12 in koka-3.1.1-BaWBegw2eC62R9E4dpMHh4:Common.Failure
  raise, called at src/Common/Failure.hs:32:5 in koka-3.1.1-BaWBegw2eC62R9E4dpMHh4:Common.Failure
  failure, called at src/Common/Failure.hs:28:11 in koka-3.1.1-BaWBegw2eC62R9E4dpMHh4:Common.Failure
  assertion, called at src/Type/Type.hs:744:5 in koka-3.1.1-BaWBegw2eC62R9E4dpMHh4:Type.Type
  appEffectExtend, called at src/Type/Type.hs:679:14 in koka-3.1.1-BaWBegw2eC62R9E4dpMHh4:Type.Type
  effectExtend, called at src/Type/Type.hs:562:14 in koka-3.1.1-BaWBegw2eC62R9E4dpMHh4:Type.Type

Failed to compile main.kk

+1, ran into this as well, seems to have been introduced after v3.0.4