#Elixir type parameter
9 messages · Page 1 of 1 (latest)
I don't think this is actually possible. The best you can get is @spec search([integer | float], integer | float) :: integer | float, which I know isn't quite the same thing
multiple @spec attributes are not supported as far as I'm aware
Multiple spec attributes are supported, but it will be merged and for Dialyzer will result with the same as what you have written, so in the end all 3 notions will be equivalent
There is currently no way to state what @torpid coral want (at least not exactly)
I see
thank you guys
@type t :: integer | float
@spec search([t], t) :: integer```
if it always returns int like your first example