Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
otp: ['24', '26']
otp: ['26', '28']
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: '3.16.1'
rebar3-version: '3.25.1'
- name: Compile and run tests
run: make
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[ {erlang_qq, {git, "https://github.com/k32/erlang_qq.git", {branch, "main"}}}
]}.

{profiles, [ {test, [ {deps, [{proper, "1.4.0"}]}
{profiles, [ {test, [ {deps, [{proper, "1.5.0"}]}
, {cover_enabled, true}
, {plugins, [rebar3_hex]}
]}
Expand Down
2 changes: 1 addition & 1 deletion rebar.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[{<<"erlang_qq">>,
{git,"https://github.com/k32/erlang_qq.git",
{ref,"beab75239f799240397aee0aec30685b9bbf33bb"}},
{ref,"21fe46d8c03ce2f65733aadf3ad97b7bb7edea28"}},
0}].
19 changes: 14 additions & 5 deletions src/typerefl_trans.erl
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ parse_transform(Forms0, Options) ->
Forms1 = add_attributes(Forms0, [ {export, Exports}
, {export_type, Exports}
]),
ReifiedTypes = maps:map(fun(_, V) ->
make_reflection_function(Module, State, V)
end,
State#s.reflected_types),
ReifiedTypes = maps:fold(fun(_, V, Acc) ->
maybe_add_doc(make_reflection_function(Module, State, V)) ++ Acc
end,
[],
State#s.reflected_types),
?log("Reified types:~n~p", [ReifiedTypes]),
%% Append type reflections to the module definition:
Forms2 = Forms1 ++ [I || {_, I} <- maps:to_list(ReifiedTypes)],
Forms2 = Forms1 ++ ReifiedTypes,
Forms = case lists:member(warn_unused_import, Options) of
true -> remove_unused_imports(Forms2);
false -> Forms2
Expand Down Expand Up @@ -390,3 +391,11 @@ maybe_add_custom_attr(Name, Line, Key, Map) ->
_ ->
[]
end.

-if(?OTP_RELEASE >= 27).
maybe_add_doc(Body) ->
[{attribute, 0, doc, false}, Body].
-else.
maybe_add_doc(Body) ->
[Body].
-endif.