diff --git a/lib/typespec.ex b/lib/typespec.ex index a011c0e875..f46a235b7f 100644 --- a/lib/typespec.ex +++ b/lib/typespec.ex @@ -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 diff --git a/test/elixir/typespec_test.exs b/test/elixir/typespec_test.exs index 2040bf6bf9..438610e25d 100644 --- a/test/elixir/typespec_test.exs +++ b/test/elixir/typespec_test.exs @@ -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