funky icon indicating copy to clipboard operation
funky copied to clipboard

Type checker does not terminate checking recursive type alias

Open fmease opened this issue 5 years ago • 0 comments

There are programs containing recursive type aliases (one fairly minimal example given below) where the type checker does not terminate ~~trying to check if two overloads collide (in this case x)~~ [see edit]:

alias T = T
func x : Int = 0
func x : T = x
func main : IO = quit

Edit: The type checker also hangs on even simpler snippets like the following:

alias T = T
func x : T = false
func main : IO = quit

You can substitute false with any term whose type is defined inside the language (via union and record) like "", [], nothing to reproduce this bug. Using primitive values (0, 'x', etcetera) on the right side, rightly produces a type error! Native types (Int, Float, Char) seem to be special-cased obviously.

fmease avatar Apr 01 '19 23:04 fmease