Closed yoshihiro503 closed 5 years ago
f(X) -> case X of ok -> 0; _ -> 1 end. main() -> f(true).
The type of the function f/1 should be any() -> number(), but it does not. So this code gets a type error.
f/1
any() -> number()
TODO:filename:-1: Type error: type mismatch; found : 'true' required: 'ok'
This is a bug of the solving algorithm. solve_disj [(X <: 'ok'); (X <: any())] should be {X |-> any()}, but it is {X |-> 'ok'}.
solve_disj [(X <: 'ok'); (X <: any())]
{X |-> any()}
{X |-> 'ok'}
The type of the function
f/1
should beany() -> number()
, but it does not. So this code gets a type error.