Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print inferred argument types on call_intersect error #491

Merged
merged 4 commits into from
Jan 31, 2023

Conversation

erszcz
Copy link
Collaborator

@erszcz erszcz commented Nov 28, 2022

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 erszcz force-pushed the call-intersect-error-message branch from 778faab to ce83a99 Compare January 29, 2023 12:15
@erszcz erszcz changed the title wip: Print inferred argument types on call_intersect error Print inferred argument types on call_intersect error Jan 29, 2023
@erszcz erszcz marked this pull request as ready for review January 29, 2023 12:20
@erszcz
Copy link
Collaborator Author

erszcz commented Jan 31, 2023

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

Copy link
Collaborator

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never understood the error about "the surrounding calling context". This is much better. 👏

@erszcz erszcz merged commit 182be65 into josefs:master Jan 31, 2023
@erszcz erszcz deleted the call-intersect-error-message branch January 31, 2023 14:04
@japhib
Copy link

japhib commented Jan 31, 2023

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants