Closed burakemir closed 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).
inferred fn:List(/any) declared fn:List(/string)
The correct type to infer for [] is fn:List(/bot) where /bot is the empty type.
[]
fn:List(/bot)
/bot
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
[]
isfn:List(/bot)
where/bot
is the empty type.