Skip to content

Invalid define is unused warning #155

@tothlac

Description

@tothlac

Bug Description

It's a very nice plugin, so probably we would like to use it on our repositories.
Unfortunately, it looks like sometimes there are false positive warnings.

To Reproduce

Run rebar3 hank on this simple code

-module(myapp). -define(EXCEPTION(C, R, Stacktrace), C:R:Stacktrace). -export([f/0]). -define(RESULT, 1). -spec f() -> term(). f() -> try ?RESULT catch ?EXCEPTION(_, _Reason, _St) -> ok end. 

Expected Behavior

hank returns the following false positive:

(base) tothlac:myapp rebar3 hank ===> Looking for code to kill with fire... ===> The following pieces of code are dead and should be removed: src/myapp.erl:7: ?RESULT is unused 

, and it should not complain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions