Skip to content

Commit bea2032

Browse files
committed
Fix CallWithoutOpaque function clause error on OTP-28
Fixes #561 by adding support for the new 5-argument format used by OTP-28 while maintaining backward compatibility with the legacy 4-argument format. The OTP-28 format passes additional type information as a 5th argument which we ignore for formatting purposes, using the same expected_triples data structure as before.
1 parent 52a15dd commit bea2032

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/dialyxir/warnings/call_without_opaque.ex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ defmodule Dialyxir.Warnings.CallWithoutOpaque do
5151
"""
5252
end
5353

54+
# OTP 28+ format (5 arguments)
55+
def format_long([module, function, args, expected_triples, _additional_type_info]) do
56+
expected = form_expected_without_opaque(expected_triples)
57+
pretty_module = Erlex.pretty_print(module)
58+
pretty_args = Erlex.pretty_print_args(args)
59+
60+
"""
61+
Function call without opaqueness type mismatch.
62+
63+
Call does not have expected #{expected}.
64+
65+
#{pretty_module}.#{function}#{pretty_args}
66+
"""
67+
end
68+
5469
# We know which positions N are to blame;
5570
# the list of triples will never be empty.
5671
defp form_expected_without_opaque([{position, type, type_string}]) do

0 commit comments

Comments
 (0)