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

function_clause crash in typechecker:get_unassigned_fields/2 #445

Closed
jesperes opened this issue Aug 30, 2022 · 2 comments · Fixed by #447
Closed

function_clause crash in typechecker:get_unassigned_fields/2 #445

jesperes opened this issue Aug 30, 2022 · 2 comments · Fixed by #447
Labels

Comments

@jesperes
Copy link

Another function_clause error:

Error: function_clause
[{lists,map,
        [#Fun<typechecker.21.54609745>,{type,0,any,[]}],
        [{file,"lists.erl"},{line,1242}]},
 {typechecker,get_unassigned_fields,2,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,2013}]},
 {typechecker,type_check_fields,3,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,1964}]},
 {typechecker,type_check_record_union_in,3,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,3348}]},
 {typechecker,do_type_check_expr_in,3,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,2496}]},
 {typechecker,type_check_expr_in,3,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,2325}]},
 {typechecker,type_check_block_in,3,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,3310}]},
 {typechecker,check_clause,5,
              [{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
               {line,3586}]}]

Last message from Gradualizer when using verbose:

97: Checking that PaccErrInfo#pacc_err_info{err = {OrigErr, Where}} :: #pacc_err_info{} | any()
Task reported error with trace from function parse_modified_error/1

The function parse_modified_error/1 looks like this:

-spec parse_modified_error(Error :: any()) -> #pacc_err_info{} | any().
parse_modified_error({{nocatch, PaccErrInfo = #pacc_err_info{}}, Where}) ->
    OrigErr = PaccErrInfo#pacc_err_info.err,
    PaccErrInfo#pacc_err_info{err = {OrigErr, Where}};
parse_modified_error(PaccErrInfo = #pacc_err_info{}) ->
    PaccErrInfo;
parse_modified_error({PaccErrInfo = #pacc_err_info{}, Where}) ->
    OrigErr = PaccErrInfo#pacc_err_info.err,
    PaccErrInfo#pacc_err_info{err = {OrigErr, Where}};
parse_modified_error(Reason) ->
    Reason.

Gradualizer version: 136f1ba

@jesperes
Copy link
Author

Confirming that #447 fixes this issue.

@erszcz
Copy link
Collaborator

erszcz commented Aug 31, 2022

Thanks, @jesperes!

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

Successfully merging a pull request may close this issue.

2 participants