From 62c27809b1d7538903f2af8532fdee2d18cb128c Mon Sep 17 00:00:00 2001 From: Roberto Aloi Date: Wed, 30 Sep 2026 04:52:53 -0700 Subject: [PATCH] Test OTP 28 and 29 in CI and fix Dialyzer opaque warning Summary: The open-source `assert` CI only tests OTP 27, although the library supports OTP 27 and later. Dialyzer from OTP 28 onwards (whose opaque type checking was reworked by EEP-69) reports an opaqueness warning in `wa_assert_parse_trans:get_line/1` that OTP 27 does not, so the green CI hides a warning users on OTP 28/29 see. CI now runs on OTP 27, 28 and 29 on both Linux and macOS, with `fail-fast` disabled so one failing version does not cancel the others, and a per-OTP Dialyzer PLT cache. `get_line/1` no longer guards with `is_integer/1` on the opaque `erl_anno:anno()`, relying on `erl_anno:is_anno/1` and `erl_anno:line/1`, which already handle plain integer lines, so behaviour is unchanged. Differential Revision: D122547164 --- .github/workflows/ci.yml | 17 ++++++++++------- src/wa_assert_parse_trans.erl | 10 +++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1715409..35d347e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,17 @@ on: jobs: build: strategy: + fail-fast: false matrix: + os: [ubuntu-22.04, macos-latest] + otp-version: [27, 28, 29] include: - - os: ubuntu-22.04 - otp-version: 27 - rebar3-version: 3.24.0 - - os: macos-latest - otp-version: 27 + - otp-version: 27 rebar3-version: 3.24.0 + - otp-version: 28 + rebar3-version: 3.27.0 + - otp-version: 29 + rebar3-version: 3.27.0 runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -44,8 +47,8 @@ jobs: uses: actions/cache@v4 with: path: ~/.cache/rebar3/rebar3_*.plt - key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }} + key: ${{ runner.os }}-otp-${{ matrix.otp-version }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }} restore-keys: | - ${{ runner.os }}-dialyzer- + ${{ runner.os }}-otp-${{ matrix.otp-version }}-dialyzer- - name: Dialyzer run: rebar3 dialyzer diff --git a/src/wa_assert_parse_trans.erl b/src/wa_assert_parse_trans.erl index e8ef5ba..be47673 100644 --- a/src/wa_assert_parse_trans.erl +++ b/src/wa_assert_parse_trans.erl @@ -154,13 +154,9 @@ process_expand_assert([Expr]) -> -spec get_line(tree()) -> non_neg_integer(). get_line(Expr) -> Anno = erl_syntax:get_pos(Expr), - case Anno of - N when is_integer(N) -> N; - _ -> - case erl_anno:is_anno(Anno) of - true -> erl_anno:line(Anno); - false -> 0 - end + case erl_anno:is_anno(Anno) of + true -> erl_anno:line(Anno); + false -> 0 end. -spec expand_comparison(tree(), tree(), [tree()], non_neg_integer()) -> tree().