Closed Qqwy closed 1 year ago
Given:
defmodule EmptyMix do defstruct [:name] use TypeCheck, enable_runtime_checks: Mix.env() != :prod @type! t :: %__MODULE__{name: String.t()} @spec! example(%{optional(String.t()) => any} | EmptyMix.t()) :: EmptyMix.t() def example(%__MODULE__{} = struct), do: struct end
one would expect this module to compile.
However, it fails with:
** (UndefinedFunctionError) function EmptyMix.t/0 is undefined (function not available)
Replacing EmptyMix.t() with plain t() circumvents the problem, but the library should be able to figure this out by itself.
EmptyMix.t()
t()
Originated from #152
The fix is part of the now-published release v0.12.4.
Given:
one would expect this module to compile.
However, it fails with:
Replacing
EmptyMix.t()
with plaint()
circumvents the problem, but the library should be able to figure this out by itself.Originated from #152