Skip to content

Wrong return value in @spec for Graph.in_edges(). #87

@dendrown

Description

@dendrown

Hello. As I understand from the documentation, Graph.in_edges() is supposed to return "a list of Graph.Edge". However, the @spec declares that only one edge is returned.

@spec in_edges(t, vertex) :: Edge.t()

This is causing Dialyzer some discomfort:

Line 1193 Column 9: The pattern [Edge] can never match the type #{'__struct__':='Elixir.Graph.Edge', 'label':=_, 'v1':=_, 'v2':=_, 'weight':=number()}
Line 1194 Column 9: The pattern [Edge | More] can never match the type #{'__struct__':='Elixir.Graph.Edge', 'label':=_, 'v1':=_, 'v2':=_, 'weight':=number()}

Note that I'm using libgraph from an Erlang module, but of course, that shouldn't matter. I'm using version 0.16.0 of the library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions