mirror of
https://github.com/valitydev/parse_trans.git
synced 2024-11-06 00:25:16 +00:00
Merge pull request #20 from uwiger/uw-typed_record_fields
make exprecs handle typed_record_fields
This commit is contained in:
commit
3958b77119
@ -432,7 +432,11 @@ add_untyped_recs(#pass1{records = Rs,
|
||||
not lists:keymember(R, 1, RTypes)],
|
||||
RTypes1 = [{R, lists:map(
|
||||
fun({record_field,L,{atom,_,A}}) -> {A, t_any(L)};
|
||||
({record_field,L,{atom,_,A},_}) -> {A, t_any(L)}
|
||||
({record_field,L,{atom,_,A},_}) -> {A, t_any(L)};
|
||||
({typed_record_field,
|
||||
{record_field,L,{atom,_,A}},_}) -> {A, t_any(L)};
|
||||
({typed_record_field,
|
||||
{record_field,L,{atom,_,A},_},_}) -> {A, t_any(L)}
|
||||
end, Def)} || {R, Def} <- Untyped],
|
||||
Acc#pass1{record_types = RTypes ++ RTypes1}.
|
||||
|
||||
@ -645,7 +649,9 @@ get_flds(Rname, #pass1{records = Rs}) ->
|
||||
{_, Flds} = lists:keyfind(Rname, 1, Rs),
|
||||
lists:map(
|
||||
fun({record_field,_, {atom,_,N}}) -> N;
|
||||
({record_field,_, {atom,_,N}, _}) -> N
|
||||
({record_field,_, {atom,_,N}, _}) -> N;
|
||||
({typed_record_field,{record_field,_,{atom,_,N}},_}) -> N;
|
||||
({typed_record_field,{record_field,_,{atom,_,N},_},_}) -> N
|
||||
end, Flds).
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user