Skip to content

Spurious redundant match diagnostic #122

@robertoaloi

Description

@robertoaloi

Describe the bug

To Reproduce**

Given the following code:

-module(test).

-export([main/1]).

main(X) ->
    case X of
        a ->
            Foo = foo,
    %% ^^^ Warning: Match is redundant
            Bar =
                case undefined of
                    undefined -> undefined
                end;
        b ->
            Foo = bar,
            Bar = baz
    end,
    #{
        foo => Foo,
        bar => Bar
    }.

Expected behavior

No diagnostics are produced.

Actual behavior

An incorrect W0007 diagnostic is reported on Foo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions