aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_lint.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-12-03 12:53:56 +0100
committerBjörn Gustavsson <[email protected]>2015-12-03 13:14:45 +0100
commitb7514ce549fc8865a2200c44fc686d46ed3d9291 (patch)
treef9a2c469c7a90be60627c5f8cafa78d162cafb89 /lib/stdlib/src/erl_lint.erl
parent78b3b26ece408ca90e3e78873e9a0212777973fe (diff)
downloadotp-b7514ce549fc8865a2200c44fc686d46ed3d9291.tar.gz
otp-b7514ce549fc8865a2200c44fc686d46ed3d9291.tar.bz2
otp-b7514ce549fc8865a2200c44fc686d46ed3d9291.zip
Extend erl_lint:format_error/1 to handle bittype mismatches
erl_lint:format_error/1 would crash with a function error if conflicting types were given. That was most easily noticed in the shell: Eshell V7.0.3 (abort with ^G) 1> <<0/integer-binary>>. *** ERROR: Shell process terminated! *** Noticed-by: Aleksei Magusev
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r--lib/stdlib/src/erl_lint.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index c4cb5fdc80..5678e7eebe 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -293,6 +293,9 @@ format_error({variable_in_record_def,V}) ->
%% --- binaries ---
format_error({undefined_bittype,Type}) ->
io_lib:format("bit type ~w undefined", [Type]);
+format_error({bittype_mismatch,Val1,Val2,What}) ->
+ io_lib:format("conflict in ~s specification for bit field: '~p' and '~p'",
+ [What,Val1,Val2]);
format_error(bittype_unit) ->
"a bit unit size must not be specified unless a size is specified too";
format_error(illegal_bitsize) ->