I’m not sure how to address the warning I’m getting from dialyzer about the typespec below:
defmodule Mastery.Core.Template do
@moduledoc false
@type t :: %__MODULE__{
name: String.t(),
category: String.t(),
instructions: String.t(),
raw: String.t(),
compiled: Macro.t(),
generators: %{subsitution: list | fun},
checker: fun(list(String.t()), String.t()) :: boolean
}
defstruct ~w[name category instructions raw compiled generators checker]a
end
This is the warning:
warning: invalid type annotation. When using the | operator to represent the union of types, make sure to wrap type annotations in parentheses: fun(list(String.t()), String.t()) :: boolean
lib/mastery/core/template.ex:4
Any ideas?