defmodule Foo do
defstruct [:foo]
@spec foo(t) :: %Foo{ foo: t } when t: any()
def foo(t) do
%Foo{foo: t}
end
end
$ mix type
Compiling 1 file (.ex)
❌ Foo.foo/1
|
| unsupported match_typespec(map, %Foo{foo: t}, %Foo{foo: any()})
|
| at unknown_file:?
I believe this should typecheck.
I believe this should typecheck.