Skip to content

unsupported match_typespec for structs #31

@turion

Description

@turion
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions