type attribute pp bug

View: New views
2 Messages — Rating Filter:   Alert me  

type attribute pp bug

by Tony Rogvall-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Re: type attribute pp bug

by Hans Bolinder-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[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

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