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

typechecker:handle_type_error({type_error,bin,0,... #75

Closed
OvermindDL1 opened this issue Nov 6, 2018 · 3 comments
Closed

typechecker:handle_type_error({type_error,bin,0,... #75

OvermindDL1 opened this issue Nov 6, 2018 · 3 comments
Labels
Milestone

Comments

@OvermindDL1
Copy link

typechecker:handle_type_error({type_error,bin,0,           
                                                              {user_type,[{file,"test_path.erl"},{location,24}],t,[]}}) (/home/overminddl1/erlang/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 2807)

It seems binary types are not being handled by the type error path? So should be a simple fix. Although the fact that the binary is not passed in like it is for strings/charlists seems odd? Also typelib:pp_type(Ty) does not seem to add the remote module name to the type so I just get something like t() instead of test_path:t() or so, and with how common t is as a type name that's not terribly helpful, plus just seeing t isn't really helpful either, it would be nice to get a list of types drilled down. :-)

@OvermindDL1
Copy link
Author

Also, this is failing because it's unable to cast a binary of an asterisk * to the unicode:chardata() type in erlang, which is just defined as binary(). I'm unsure whether it's better to do strong types or soft types here, blah...

@OvermindDL1
Copy link
Author

If I pass the BinElements across to the error and print out the error then I print out:

The binary [{bin_element,0,{string,0,"*"},default,default}] on line 0 does not have type t()

Line 0 is quite wrong as well, and type t() tells me nothing since the module this is defined in doesn't have a type t(), but rather test_path.t() is what it should be referencing.

@josefs josefs added the bug label Nov 6, 2018
@josefs
Copy link
Owner

josefs commented Nov 6, 2018

Thanks for the bug report! We will want to fix this one as part of #59.

@zuiderkwast zuiderkwast added this to the Beta release milestone Nov 13, 2018
zuiderkwast added a commit to zuiderkwast/Gradualizer that referenced this issue Nov 18, 2018
This allows us to do more exact checking of bit expressions and patterns.

Fixes josefs#75, josefs#89.
zuiderkwast added a commit to zuiderkwast/Gradualizer that referenced this issue Nov 18, 2018
This allows us to do more exact checking of bit expressions and patterns.

Fixes josefs#75, fixes josefs#89.
zuiderkwast added a commit to zuiderkwast/Gradualizer that referenced this issue Nov 18, 2018
This allows us to do more exact checking of bit expressions and patterns.

Fixes josefs#75.
Fixes josefs#89.
zuiderkwast added a commit to zuiderkwast/Gradualizer that referenced this issue Nov 19, 2018
This allows us to do more exact checking of bit expressions and patterns.

Fixes josefs#75.
Fixes josefs#89.
zuiderkwast added a commit that referenced this issue Nov 19, 2018
This allows us to do more exact checking of bit expressions and patterns.

Fixes #75.
Fixes #89.
berbiche pushed a commit to berbiche/Gradualizer that referenced this issue Feb 9, 2021
This allows us to do more exact checking of bit expressions and patterns.

Fixes josefs#75.
Fixes josefs#89.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants