-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When a type is defined as follows:
defmodule A do
use TypeCheck
@type! t() :: %{v: integer()}
@spec! f(t()) :: integer()
def f(x), do: x.v
end
TypeCheck
works correctly, but if I try to use TypeCheck.conforms?
in the same module where a type is defined, I get a complation error:
defmodule A do
use TypeCheck
@type! t() :: %{v: integer()}
def main() do
x = 1
TypeCheck.conforms?(x, t())
end
end
== Compilation error in file lib/examples.ex ==
** (UndefinedFunctionError) function A.t/0 is undefined (function not available)
A.t()
(stdlib 3.17) erl_eval.erl:685: :erl_eval.do_apply/6
(elixir 1.13.4) lib/code.ex:797: Code.eval_quoted/3
(type_check 0.12.1) lib/type_check/type.ex:96: TypeCheck.Type.build_unescaped/4
(type_check 0.12.1) lib/type_check.ex:202: TypeCheck."MACRO-conforms?"/4
(type_check 0.12.1) expanding macro: TypeCheck.conforms?/2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working