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

"Cannot load module" error gets swallowed #95

Open
msz opened this issue Nov 18, 2021 · 0 comments
Open

"Cannot load module" error gets swallowed #95

msz opened this issue Nov 18, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@msz
Copy link
Owner

msz commented Nov 18, 2021

In a complex type, when there is a module that cannot be loaded, and the types are similar (the type match stacks are the same height) the error is instead that it couldn't match the last element of the union. Possible working example:

defmodule Module1 do
  @type t :: :module1
end

defmodule Module3 do
  @type t :: :module3
end

defmodule Foo do
  @callback foo() :: {:ok, Module1.t()} | {:ok, Module2.t()} | {:ok, Module3.t()}
  def foo, do: {:ok, :nothing}
end

Expected kind of error from calling protected Foo.foo/0: "Could not load Module2"
Actual kind of error from calling protected Foo.foo/0: "Could not match Module3"

@msz msz added the bug Something isn't working label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant