function_clause crash in `gradualizer_int:int_type_to_range`
jesperes opened this issue · comments
I get a function_clause
crash like this when running Gradualizer on our code:
Error: function_clause
[{gradualizer_int,int_type_to_range,
[{var,0,'T'}],
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/gradualizer_int.erl"},
{line,106}]},
{gradualizer_int,negate_int_type,1,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/gradualizer_int.erl"},
{line,95}]},
{typechecker,do_type_check_expr,2,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
{line,1869}]},
{typechecker,type_check_expr,2,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
{line,1550}]},
{typechecker,do_type_check_expr_in,3,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
{line,2330}]},
{typechecker,type_check_expr_in,3,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
{line,2321}]},
{typechecker,check_clause,5,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
{line,3581}]},
{typechecker,'-check_clauses/5-fun-0-',4,
[{file,"/home/jespereskilson/dev/kred/_build/default/plugins/gradualizer/src/typechecker.erl"},
{line,3489}]}
If I run with verbose
enabled, it tells me this immediately before the crash
Checking function commission/1
Pushing {clauses_controls,true}
94: Checking clause :: any()
94: Checking that -lists:min([C, 0]) :: any()
94: Checking that [C, 0] :: [T, ...]
94: Checking that C :: T
94: Checking that [0] :: [T]
94: Checking that 0 :: T
94: Checking that [] :: [T] | []
94: Propagated type of lists:min([C, 0]) :: T
Task reported error with trace from function commission/1
OTP: 23.3.4.2
Gradualizer: latest master (f00f1d2)
This should not be an issue anymore with the current master branch. @jesperes could you confirm?
I thought I was using latest master, but let me check again.
This seems to have disappeared, yes. However, I am hitting another crash lateron. Will report a separate issue.
I thought I was using latest master, but let me check again.
I'm sure you had been, but then we merged a patch based on your report.
This seems to have disappeared, yes. However, I am hitting another crash lateron. Will report a separate issue.
Awesome, thanks for confirmation 👍 Bring it on!