evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.09k stars 39 forks source link

Typecheck type variables #33

Closed evincarofautumn closed 11 years ago

evincarofautumn commented 11 years ago

Currently this is not done, so programs can typecheck that will fail at runtime.

evincarofautumn commented 11 years ago

Quoth @strager:

The following typechecks but fails during interpretation:

def ; ([a] a -> [a]): prepend

([Char])[]
'a'; 'b';

Type of prepend:

def prepend (a [a] -> [a])

Error:

kitten: user error (Pattern match failure in do expression at lib/Kitten/Interpret.hs:90:5-14)
evincarofautumn commented 11 years ago

Currently working on reinstating type inference; this issue is still relevant but its solution will look very different.