Skip to content

Dialyzer warnings #56

@UncleGrumpy

Description

@UncleGrumpy

Dialyzer emits several warnings when checking packbeam.erl and packbeam_api.erl. These warnings should be fixed and a dialyzer check added to the tests.

Output from rebar3 dialyzer:

src/packbeam.erl
Line 40 Column 1: Function create/2 has no local return
Line 48 Column 1: Function create/4 has no local return
Line 73 Column 1: Function main/1 has no local return
Line 182 Column 1: Function do_create/2 has no local return
Line 188 Column 9: The call packbeam_api:create(OutputFile::any(), InputFiles::[any()], #{'include_lines':=boolean(), 'lib':=_, 'prune':=_, 'start_module':=_}) breaks the contract (OutputPath::path(), InputPaths::[path()], Options::options()) -> 'ok' | {'error',Reason::term()}

src/packbeam_api.erl
Line 98 Column 2: Invalid type specification for function packbeam_api:create/2. The success typing is (_,_) -> none() but the spec is (OutputPath::path(),InputPaths::[path()]) -> 'ok' | {'error',Reason::term()}
Line 102 Column 1: Function create/2 has no local return
Line 103 Column 37: The call packbeam_api:create(OutputPath::any(), InputPaths::any(), #{'application_module'=>'undefined', 'include_lines'=>'true', 'lib'=>'false', 'prune'=>'false', 'start_module'=>'undefined'}) breaks the contract (OutputPath::path(), InputPaths::[path()], Options::options()) -> 'ok' | {'error',Reason::term()}
Line 159 Column 2: Invalid type specification for function packbeam_api:create/4. The success typing is (_,_,_,_) -> none() but the spec is (OutputPath::path(),InputPaths::[path()],Prune::boolean(),StartModule::module() | 'undefined') -> 'ok' | {'error',Reason::term()}
Line 166 Column 1: Function create/4 has no local return
Line 171 Column 36: The call packbeam_api:create(OutputPath::any(), InputPaths::any(), #{'application_module':='undefined', 'include_lines':='true', 'lib':='false', 'prune':=_, 'start_module':=_}) breaks the contract (OutputPath::path(), InputPaths::[path()], Options::options()) -> 'ok' | {'error',Reason::term()}
Line 197 Column 2: Invalid type specification for function packbeam_api:create/5. The success typing is (_,_,_,_,_) -> none() but the spec is (OutputPath::path(),InputPaths::[path()],ApplicationModule::module() | 'undefined',Prune::boolean(),StartModule::module() | 'undefined') -> 'ok' | {'error',Reason::term()}
Line 205 Column 1: Function create/5 has no local return
Line 212 Column 36: The call packbeam_api:create(OutputPath::any(), InputPaths::any(), #{'application_module':=_, 'include_lines':='true', 'lib':='false', 'prune':=_, 'start_module':=_}) breaks the contract (OutputPath::path(), InputPaths::[path()], Options::options()) -> 'ok' | {'error',Reason::term()}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions