evincarofautumn / kitten

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

Type instance checks #94

Closed strager closed 10 years ago

strager commented 10 years ago

Each of the following typecheck but should not:

def example1 (-> a): 10
def example2 (Int a -> a a) { } // r
def example3 (a Int -> a a) { } // r
def example4 (a -> b) { } // r
def example5 (a -> Int) { } // r
def example6 (->): ->x x // r
def example7 (->): ->{x y} y x // r
def example8 (Int a -> a a): ->{x y} x y
def example9 (a Int -> a a): ->{x y} x y
def example10 (a -> b): ->x x
def example11 (a -> Int): ->x x

Examples marked with // r have a mismatch in inferred and declared arity.

strager commented 10 years ago

Also, this should typecheck (and currently does):

def nonexample1 (a -> a) { }
evincarofautumn commented 10 years ago

Fixed by #112.