From 2034bf39c732ad2cfc645a85521d559b98224709 Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:31:48 +0100 Subject: [PATCH 1/3] Update proper dependency --- rebar.config | 2 +- rebar.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rebar.config b/rebar.config index fa91e7d..120a155 100644 --- a/rebar.config +++ b/rebar.config @@ -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]} ]} diff --git a/rebar.lock b/rebar.lock index a53be07..a094699 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,4 +1,4 @@ [{<<"erlang_qq">>, {git,"https://github.com/k32/erlang_qq.git", - {ref,"beab75239f799240397aee0aec30685b9bbf33bb"}}, + {ref,"21fe46d8c03ce2f65733aadf3ad97b7bb7edea28"}}, 0}]. From e515d630b4ae08c085acdf04fe445bc51fef0dd9 Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:32:06 +0100 Subject: [PATCH 2/3] Add `-doc false.` attribute for reflected functions --- src/typerefl_trans.erl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/typerefl_trans.erl b/src/typerefl_trans.erl index 5af9910..99f728d 100644 --- a/src/typerefl_trans.erl +++ b/src/typerefl_trans.erl @@ -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 @@ -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. From 933a09baf21202967e428432ad87bfda497fcf25 Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:39:17 +0100 Subject: [PATCH 3/3] Run tests on OTP28 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70870e0..6f94bf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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