For folks who see this in the future, see @kokolegorille post Type and spec - Dialyzer not detecting error
If at least one type matches, then Dialyzer will not generate a warning. See this base case:
@spec hello(integer()) :: map()
def hello(int) do
case int do
1 -> %{hello: "world"}
_ -> :doesnterror
end
end
Regarding the The type specification has too many types for the function errors, this is just because a spec is being defined with too many types for the function being created. The evaluation is different when behaviors are included.