Skip to content

Unused module attribute showing incorrect line number #5490

@TBK145

Description

@TBK145

Environment

  • Elixir version (elixir -v):
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]

IEx 1.4.0-dev (050780c)
  • Operating system: Ubuntu 16.04

Current behavior

If I compile a module with unused module attributes I get a warning with a wrong line number:

warning: module attribute @agent_key was set but never used
  lib/queue.ex:1
~$ grep @agent_key * -RIn
lib/queue.ex:67:  @agent_key  :uri

I know you're supposed to define module attributes at the top of your file, but even then, when defining multiple module attributes, you would have the same problem.

Expected behavior

I would expect a warning to be given with lib/queue.ex:67.

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