Minimal reproduction for MapSet Dialyzer opacity warnings introduced by
Elixir 1.20. OTP 29 is not required to reproduce it.
This repository defaults to Elixir 1.20.0-rc.5 on OTP 29:
elixir --versionExpected relevant version shape:
Elixir 1.20.0-rc.5 ... Erlang/OTP 29
Run:
mix deps.get
mix dialyzerVerified results:
| Elixir | Erlang/OTP | Result |
|---|---|---|
| 1.20.0-rc.5 | 29 | Reproduces |
| 1.20.0-rc.5 | 28.5 | Reproduces |
| 1.19.5 | 28.5 | Does not reproduce |
The reproducing code is in lib/demo.ex:
def contains?(ids, id) do
id_set = MapSet.new(ids)
MapSet.member?(id_set, id)
endDialyzer reports id_set as %MapSet{:map => map()} and rejects it as the first
argument to MapSet.member?/2, whose implementation expects a MapSet.t() with
opaque :sets.set(_) internals.