I believe the way dialyzer works, you can write two specs and it's valid.
For example:

@spec foo(1) :: "one"
@spec foo(2) :: "two"
def foo(1), do: "one"
def foo(2), do: "two"

Allen Madsen
http://www.allenmadsen.com


On Mon, Apr 5, 2021 at 8:38 AM eksperimental <[email protected]>
wrote:

> On Mon, 5 Apr 2021 09:43:39 +0200
> José Valim <[email protected]> wrote:
>
> > This is most likely the job of Dialyzer and tools working on
> > typespecs to do. As they can do a better job at that.
>
> There are cases where specs may be used for documentation purposes
> only, and Dialyzer may not ever been run.
>
> I actually came across this when I tried to fix a spec that I could
> read from the docs was wrong, but when I corrected it, I ended up
> creating a duplicate.
> https://github.com/phoenixframework/phoenix_html/pull/332
>
> I am not suggesting doing any any analysis on specs just checking for
> duplicates, since this check can be done at compile time.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/606b04ca.1c69fb81.68e7d.7b07SMTPIN_ADDED_MISSING%40gmr-mx.google.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3CvHJ2%3DhQ9NQTTjwSLC5h7wsq0n%3Do7a0mkwHE75xfywi%3DQ%40mail.gmail.com.

Reply via email to