You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defining multiple different specs for the same function is indeed allowed in Elixir/Erlang's own typespecs, but not currently in TypeCheck.
We do want to support this in the future, but it requires some work to get the implementation right.
Maybe the current limitation was surprising.
Do you think we should make it more visible in the documentation maybe?
For the time being, I recommend writing down a single spec in the format
Making it more visible in the documentation will definetely be very useful while this is not implemented.
Maybe TypeCheck could also throw a compilation warning when it finds more than one spec for a function. This will be very useful for the user, because the current behaviour doesn't allow the user to correctly invoke the function with multiple specs.
With this function definition of
f
I would expect TypeCheck to allow calling f with integers and booleans, but the current behaviour is:The text was updated successfully, but these errors were encountered: