Background
I have a module that is a GenStage. I am trying to make this module dyalizer compliant but I am not sure if I am going overboard with @spec.
Code
Imagine we have the following code:
@impl GenStage
def init(args) do
{:producer_consumer, nil}
end
This code is the init callback of a GenStage (called after running start_link).
I wonder if I should let it be (because it is clear that it is already using the behaviour) or if I should add further information:
@spec init(any) :: {:producer_consumer, nil}
@impl GenStage
def init(args) do
{:producer_consumer, nil}
end
Questions
- Which of the two version is correct?
- Which version would be better for dialyzer? (does it make a difference at all?)


















