[erlang-questions] Can't run my command line Erlang program

Steve Vinoski <>
Fri Nov 15 01:57:14 CET 2013


On Thu, Nov 14, 2013 at 7:46 PM, Andrew Pennebaker <
> wrote:

> Dialyzer:
>
> erlc -Wall +debug_info ios7crypt.erl
> dialyzer *.beam --build_plt --quiet
> dialyzer *.beam
>   Checking whether the PLT /Users/andrew/.dialyzer_plt is up-to-date... yes
>   Proceeding with analysis...
> ios7crypt.erl:60: The pattern 'true' can never match the type 'false'
> ...
>
> In particular, I'm confused what dialyzer doesn't like about line 60.
>
> 59  FirstOne = case is_binary(FirstTemp) of
> 60    true -> binary_to_list(FirstTemp);
> 61    false -> FirstOneRaw
> 62  end,
>
> Not sure what's wrong. I tried using `_` instead of `false`, but got the
> same warning. Should I use an if/else instead of case?
>

The code preceding this (on line 57) calls lists:nthtail, which returns a
list. Therefore the is_binary test on line 59 will always return false, so
the true branch will never be taken.

--steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131114/6a76a8d9/attachment.html>


More information about the erlang-questions mailing list