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

Fix broken typespecs #701

Merged
merged 2 commits into from
Mar 31, 2019
Merged

Fix broken typespecs #701

merged 2 commits into from
Mar 31, 2019

Conversation

rodrigues
Copy link
Contributor

@rodrigues rodrigues commented Mar 31, 2019

I don't know if Module.t() was ever valid elixir, but at least in elixir 1.8.1 it's not:

> t Module
@typep def_kind() :: :def | :defp | :defmacro | :defmacrop

@typep definition() :: {atom(), arity()}

I have one application using absinthe, and it shows this dialyzer error:

:0:unknown_type
Unknown type: Module.t/0.

The error is gone after this change 👍🏼

EDIT:

Another dialyzer error fixed (just a missing alias)

:0:unknown_type
Unknown type: Object.t/0.
________________________________________________________________________________

@rodrigues
Copy link
Contributor Author

rodrigues commented Mar 31, 2019

By the way, there is still one dialyzer error I get in my application that I think it's related to absinthe itself, or absinthe_plug, but I couldn't fix it yet:

:0:unknown_type
Unknown type: Absinthe.Blueprint.Document.Resolution.node_t/0.

It's confusing, seems some result structs point to a module/type that don't exist, I don't know what is the new namespace of this module, if it still exists:

lib/absinthe/blueprint/result/leaf.ex
17:          value: Blueprint.Document.Resolution.node_t(),

lib/absinthe/blueprint/result/list.ex
17:          values: [Blueprint.Document.Resolution.node_t()],

lib/absinthe/blueprint/result/object.ex
18:          fields: [Blueprint.Document.Resolution.node_t()],

EDIT: it looks like all usage of node_t() in the code refers to Absinthe.Blueprint.node_t(), is that the one instead?

@rodrigues rodrigues changed the title Fix module type usage Fix broken typespecs Mar 31, 2019
@benwilson512
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants