-
Notifications
You must be signed in to change notification settings - Fork 33
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
Prevent dialyzer warnings on OTP 23 #105
Prevent dialyzer warnings on OTP 23 #105
Conversation
I'm having a hard time getting rid of these src/hex_pb_package.erl
1395: The pattern <X, Path> can never match since previous clauses completely covered the type <integer(),['Package' | 'Release' | 'RetirementStatus' | 'reason' | 'releases' | 'retired',...]>
src/hex_registry.erl
83: Function sign_protobuf/2 has no local return
85: The call hex_pb_signed:encode_msg(#{'payload':=binary(), 'signature':=binary()}, 'Signed') will never return since the success typing is (#{'payload':=binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | [])}, 'Signed') -> binary() and the contract is ('Signed'(), atom()) -> binary() I bumped The first issue relates to an internal function, so it seems like a generation issue. |
I opened tomas-abrahamsson/gpb#188 to get more info. and figure out if there's a better way to proceed. |
According to tomas-abrahamsson/gpb#188 (comment), Note: there's still a potential issue there, regarding the generation of specs for maps, though, so this would also benefit from waiting for that "fix". |
hex_core needs to support OTP 17. This is because it needs to be usable by Hex which in turns needs to be usable by Elixir 1.0.x. At some point Hex will no longer support old Elixir versions but not quite yet. |
What are other options to suppress the warnings, is there anything we can do in |
I'm not sure it's possible to tell I don't think stripping the specs would help here either, since at least one of the errors has nothing to do with the specs themselves, but with the fact that the |
I'm not sure. Do you have a proposal how this would work while keeping the compatibility? I can think of two workarounds:
neither approach seems good, it adds bloat to the package and may increase maintenance burden, so I don't think I'd pursue that. |
Not yet, no. I'll try to find the time to cook something up. In any case, I'm specifically talking about the vendored modules, which are simply generated and included somewhere else (much like |
…OS vars Usage: TARGET_ERLANG_VERSION=19 rebar3 as dev compile
72803c6 adds the possibility to generate different Erlang-targeted Note: this would effectively conclude this pull request, since I don't think it'll be possible to reach 0-warnings given the current expected constraints. |
Do you think anything's still missing? Could I propose a merge and release, if all's OK with you? |
-type headers() :: #{binary() => binary()}. | ||
-export_type([headers/0]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll be changing this type in the future (#77) but it's probably ok to export it since we use it elsewhere, otherwise we get the warnings.
Thank you! |
Thank you. Any change this gets a release soon, so it's vendored into |
Found these while
dialyzer
'ingrebar3
.Opening as a draft pull request, since I don't know when this'll be ready for review, but it's not now.