diff options
author | Stavros Aronis <[email protected]> | 2011-07-16 13:53:03 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-08-01 16:06:16 +0200 |
commit | ada2590f3397fb75a2648898acf6f8920e1344a8 (patch) | |
tree | f446d4bfd8abad8272a7274a5fe06bade27b46af /lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl | |
parent | 5a68d017d583f4d9f046d6581fb9f9c2337403c6 (diff) | |
download | otp-ada2590f3397fb75a2648898acf6f8920e1344a8.tar.gz otp-ada2590f3397fb75a2648898acf6f8920e1344a8.tar.bz2 otp-ada2590f3397fb75a2648898acf6f8920e1344a8.zip |
Add codec_can and list_to_bitstring tests
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl b/lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl new file mode 100644 index 0000000000..2da708cb15 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl @@ -0,0 +1,21 @@ +%%===================================================================== +%% From: Ken Robinson +%% Date: 28/04/2011, 17:26 +%% +%% Program that produced borus "Function has no local return" warnings +%% due to erlang:list_to_bitstring/1 having erroneous hard coded type +%% information, namely accepting iolist() instead of bitstrlist(). +%% Fixed 29/04/2011. +%%===================================================================== + +-module(list_to_bitstring). + +-export([l2bs/0, l2bs_ok/0]). + +%% This function was producing a warning +l2bs() -> + erlang:list_to_bitstring([<<42>>, <<42:13>>]). + +%% while this one was ok. +l2bs_ok() -> + erlang:list_to_bitstring([<<42>>, <<42,42>>]). |