josefs / Gradualizer

A Gradual type system for Erlang
MIT License
613 stars 35 forks source link

Print inferred argument types on call_intersect error #491

Closed erszcz closed 1 year ago

erszcz commented 2 years ago

Fixes #484.

The argument types are inferred, so they might not be completely accurate in each case. Example printout from Gradualizer's self-check:

ebin/typechecker.beam: type_error/5 call arguments on line 3345 at column 11 don't match the function type:
fun((call_arity, anno(), atom(), arity(), arity()) -> error())
fun((type_error(), binary_op(), anno(), type(), type()) ->
                  error())
Inferred argument types:
call_intersect, any(), any(), any(), [type()]

@japhib what do you think of the above message format?

erszcz commented 1 year ago

@zuiderkwast WDYT? This PR is useful for debugging #512, so I got back to finishing it now.

japhib commented 1 year ago

Looks great!