2 ms·
Dialyzer messages can be pretty obtuse. Usually I take it as a cue to just re-read the function and it's often somewhat clear where the problem lies due to immu
by elcritch 6y ago
Dialyzer messages can be pretty obtuse. Usually I take it as a cue to just re-read the function and it's often somewhat clear where the problem lies due to immutability (not always though).
Another trick I'll do, is to use (abuse) pattern matching:
def foo(%SomeStruct{} = arg, value) when is_integer(value) ...
That also helps Dialyzer narrow down possibilities too and will blow up on runtime.
If you use VSCode, the ElixirLS module will auto-suggest @spec's for your functions.