[erlang-questions] type attribute pp bug

1 view
Skip to first unread message

Tony Rogvall

unread,
Nov 6, 2009, 9:47:39 AM11/6/09
to erlang-questions Questions
Hi!

Found a "small" bug in erl_pp handling of the type declaration.
The "code" compiles, but with -E flag will result in a crash.


-module(type_bug).

-type foo() :: integer().


> erlc -E type_bug.erl

./type_bug.erl:none: internal error in listing;
crash reason: {function_clause,
[{erl_pp,typeattr,
[type,[{foo,{type,4,integer,[]},[]}],none]},
{erl_pp,lattribute,2},
{erl_pp,form,2},
{compile,'-src_listing/2-anonymous-0-',2},
{lists,foreach,2},
{compile,listing,3},
{compile,'-internal_comp/4-anonymous-1-',2},
{compile,fold_comp,3}]}
./type_bug.erl:4: Warning: type foo() is unused


/Tony


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Hans Bolinder

unread,
Nov 6, 2009, 3:51:52 PM11/6/09
to erlang-q...@erlang.org
[Tony Rogvall:]

> Found a "small" bug in erl_pp handling of the type declaration.
> The "code" compiles, but with -E flag will result in a crash.

Thanks!

The bug has been corrected; snapshots downloaded after 10th October
should be OK. The modules erl_expand_records, epp.erl, and compile.erl
have been modified.

Mail me if you need a patch.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson

Reply all
Reply to author
Forward
0 new messages