Changes = operator to :: for typespec annotations
This commit is contained in:
+1
-1
@@ -66,7 +66,7 @@ defmodule Typespec do
|
||||
quote do: {:integer, 0, unquote(integer)}
|
||||
end
|
||||
|
||||
defp typespec({:"=", line,[var,expr]}, vars, caller) do
|
||||
defp typespec({:"::", line,[var,expr]}, vars, caller) do
|
||||
quote do: {:ann_type, unquote(line), [unquote(typespec(var, [elem(var,1)|vars], caller)), unquote(typespec(expr, vars, caller))]}
|
||||
end
|
||||
|
||||
|
||||
@@ -195,8 +195,8 @@ defmodule Typespec.Test.Type do
|
||||
test "deftype with annotations" do
|
||||
{spec1, spec2} =
|
||||
test_module do
|
||||
t1 = deftype mytype, as: named=integer
|
||||
t2 = deftype mytype1, as: fun(a=integer), returns: integer
|
||||
t1 = deftype mytype, as: named :: integer
|
||||
t2 = deftype mytype1, as: fun(a :: integer), returns: integer
|
||||
{t1,t2}
|
||||
end
|
||||
assert {:type, {:mytype, {:ann_type, _, [{:var, _, :named}, {:type, _, :integer, []}]}, []}} = spec1
|
||||
|
||||
Reference in New Issue
Block a user