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

Dialyzer issues for required fields #91

Closed
sargun opened this issue Oct 4, 2016 · 2 comments
Closed

Dialyzer issues for required fields #91

sargun opened this issue Oct 4, 2016 · 2 comments

Comments

@sargun
Copy link

sargun commented Oct 4, 2016

When the codegen goes over required fields, it generates code like:


'merge_msg_mesos_state_agentoverlayinfo.state'(#'mesos_state_agentoverlayinfo.state'{status
                       =
                       PFstatus,
                         error
                       =
                       PFerror},
                 #'mesos_state_agentoverlayinfo.state'{status
                       =
                       NFstatus,
                         error
                       =
                       NFerror},
                 _) ->
    #'mesos_state_agentoverlayinfo.state'{status =
                if NFstatus =:= undefined ->
                 PFstatus;
             true -> NFstatus
                end,
            error =
                if NFerror =:= undefined ->
                 PFerror;
             true -> NFerror
                end}.

The generated typespec for status / NFstatus doesn't include undefined. Given this, if NFstatus =:= undefined should never match. I think that the codegen should omit that if the field is required in the merge function.

@tomas-abrahamsson
Copy link
Owner

Agree this looks wrong, will take a look.

@tomas-abrahamsson
Copy link
Owner

I just pushed 3.26.3, which fixes this issue (hence closing) Thanks for reporting!

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

No branches or pull requests

2 participants