koka
koka copied to clipboard
termination checker ignores types with recursive occurances in negative position
rec type foo
Foo(recur: foo -> int)
fun yeet(x: foo) : int
match x
Foo(recur) -> recur(x)
fun yoot() : int
yeet(Foo(yeet))
fun main() : console ()
yoot().show().println()
this compiles successfully. I would expect yeet and yoot to have the div effect.
Running this results in a segfault.
lcnr@lcnr-pc:~/koka-learn$ koka --version
Koka 2.3.8, 10:27:37 Dec 27 2021 (ghc release version)
version: 2.3.8
bin : /usr/local/bin
lib : /usr/local/lib/koka/v2.3.8
share : /usr/local/share/koka/v2.3.8
output : .koka/v2.3.8/gcc-debug
cc : /usr/bin/gcc
Duplicate of #149 (but better title, I guess)
Thanks -- that is definitely a bug; hmm -- wonder where Koka regressed. I'll add your program to the test suite. tbc (Thanks Anton -- the same bug indeed)