Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struct update causes crash #32

Open
turion opened this issue Dec 9, 2020 · 0 comments · May be fixed by #44
Open

Struct update causes crash #32

turion opened this issue Dec 9, 2020 · 0 comments · May be fixed by #44

Comments

@turion
Copy link
Contributor

turion commented Dec 9, 2020

Related to #31 #29.

defmodule Foo do
  defstruct [:foo]
  @spec foo(t) :: %Foo{ foo: t } when t: any()

  def foo(t) do
    %Foo{foo(23) | foo: t}
  end
end
$ mix type
Compiling 1 file (.ex)
** (FunctionClauseError) no function clause matching in anonymous fn/1 in ExType.Checker.eval/2    
    
    The following arguments were given to anonymous fn/1 in ExType.Checker.eval/2:
    
        # 1
        {:|, [line: 6], [{:foo, [line: 6], [23]}, [foo: {:t, [line: 6], nil}]]}
    
    lib/ex_type/checker.ex:66: anonymous fn/1 in ExType.Checker.eval/2
    (elixir 1.10.4) lib/enum.ex:1396: Enum."-map/2-lists^map/1-0-"/2
    lib/ex_type/checker.ex:66: ExType.Checker.eval/2
    lib/ex_type/typespec.ex:795: anonymous fn/3 in ExType.Typespec.match_typespec/3
    (elixir 1.10.4) lib/enum.ex:3343: Enum.flat_map_list/2
    lib/ex_type/typespec.ex:778: anonymous fn/4 in ExType.Typespec.match_typespec/3
    (elixir 1.10.4) lib/enum.ex:3343: Enum.flat_map_list/2
    lib/ex_type/typespec.ex:776: ExType.Typespec.match_typespec/3
turion pushed a commit to turion/ex_type that referenced this issue Dec 9, 2020
turion pushed a commit to turion/ex_type that referenced this issue Dec 25, 2020
turion pushed a commit to turion/ex_type that referenced this issue Dec 25, 2020
turion pushed a commit to turion/ex_type that referenced this issue Dec 26, 2020
turion pushed a commit to turion/ex_type that referenced this issue Dec 26, 2020
turion pushed a commit to turion/ex_type that referenced this issue Feb 24, 2021
turion pushed a commit to turion/ex_type that referenced this issue Feb 24, 2021
@turion turion linked a pull request Feb 24, 2021 that will close this issue
turion pushed a commit to turion/ex_type that referenced this issue Feb 14, 2022
turion pushed a commit to turion/ex_type that referenced this issue Feb 14, 2022
turion added a commit to turion/ex_type that referenced this issue Apr 1, 2022
turion pushed a commit to turion/ex_type that referenced this issue Apr 1, 2022
turion pushed a commit to turion/ex_type that referenced this issue Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant