google / mangle

Apache License 2.0
1.09k stars 38 forks source link

Type inference for empty list #26

Closed burakemir closed 11 months ago

burakemir commented 11 months ago

Type inference infers the wrong type for empty list.

I had a program with a decl

Decl foo bound [/foo, fn:List(/string)].

and a rule

foo(X, []) :- ...

and got an error that inferred fn:List(/any) declared fn:List(/string).

The correct type to infer for [] is fn:List(/bot) where /bot is the empty type.