[erlang-bugs] erl_pp having problems with typed record defs

Ulf Wiger <>
Sun Oct 23 14:10:52 CEST 2011

I noticed that erl_pp gets very unhappy with typed records.



-record(r, {i = 0 :: integer()}).

f() ->

uwbook:src uwiger$ erlc -W +debug_info trec.erl
uwbook:src uwiger$ pp trec.beam
-file("./trec.erl", 1).
-record(r,{i = 0}).
-type {record,r}() ::
f() ->

I'm using OTP R14B04.
alias pp='escript /Users/uwiger/ETC/git/parse_trans/ebin/parse_trans_pp.beam'

where parse_trans_pp basically does:

		   io_lib:fwrite("~s~n", [lists:flatten(
					    [erl_pp:form(Form) ||
						Form <- AC])])

It seems to me as if the issue is that the typed record spec gets broken up in two different forms, and erl_pp:form/1 obviously can't put them together again, as it gets one form at a time.

Any suggestions on how to get around this?

Ulf W

Ulf Wiger, CTO, Erlang Solutions, Ltd.

More information about the erlang-bugs mailing list