summaryrefslogtreecommitdiff
path: root/lib/dialyzer/test/small_SUITE_data/src/list_to_bitstring.erl
blob: 109aa88f16c5494c24b274f12a5c09008c703b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
%%=====================================================================
%% From: Ken Robinson
%% Date: 28/04/2011, 17:26
%%
%% Program that produced bogus "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>>]).