[erlang-bugs] typer crash for <<_:32, _:_*8>>

Radosław Bułat radek.bulat@REDACTED
Mon May 16 22:11:34 CEST 2011


I have code like this:

    -module(erlangbug).
    -export([bug/0]).

    bug() ->
      Bin = <<"Hello World">>,
      <<(size(Bin)):32, Bin/binary>>.

Now i run typer for that file:

    $ typer --show erlangbug.erl

    %% File: "erlangbug.erl"
    %% ---------------------
    -spec bug() -> <<_:32,_:_*8>>.

It seems ok but now I add that spec to the file:

    -module(erlangbug).
    -export([bug/0]).

    -spec bug() -> <<_:32,_:_*8>>.
    bug() ->
      Bin = <<"Hello World">>,
      <<(size(Bin)):32, Bin/binary>>.

and run typer again:

    $ typer --show erlangbug.erl

    %% File: "erlangbug.erl"
    %% ---------------------
    {"init terminating in
do_boot",{{case_clause,8},[{erl_types,t_form_to_string,1},{erl_types,t_form_to_string,1},{dialyzer_contracts,contract_to_string_1,1},{typer,get_type_string,4},{typer,'-show_type_info/2-fun-0-',2},{lists,foreach,2},{typer,start,0},{init,start_it,1}]}}

    Crash dump was written to: erl_crash.dump
    init terminating in do_boot ()

-- 
Pozdrawiam

Radosław Bułat
http://radarek.jogger.pl - mój blog



More information about the erlang-bugs mailing list