Dialyzer complaining about function head not matching, when subsequent head should

I’m getting a dialyzer error and I don’t understand why.

The pattern
:nack, _, _wait_time

can never match the type
%{:__exception__ => true, :__struct__ => atom(), atom() => _}, _, integer()

The code it’s complaining about is here:

It is true, that particular function head will not match, but the one following that should match that pattern fine.

1 Like

This is basically what dialyzer is telling you. It is saying that that particular clause of the log_error/3 function will never match as it will never be called with the first argument as :nack. It is not complaining about the function as a whole.

Yes, sometimes dialyzer warnings can be a bit cryptic to understand. :wink: It is generally trying to work both ways with functions and match a definition of a function and the calls to it and check if they work. It uses something called Success typing.


Thanks, it appears I was calling a function with one too few arguments.

1 Like