Skip to content

internal error in pass lint_module: bad argument not an atom #11401

Description

@lmaltsis

Describe the bug

$ erlc /tmp/bug.erl
/tmp/bug.erl: internal error in pass lint_module:
exception error: bad argument
  in function  atom_to_list/1
     called as atom_to_list({a,2})
     *** argument 1: not an atom
  in call from erl_lint:check_module_name/3 (erl_lint.erl:4385)
  in call from erl_lint:behaviour_callbacks/3 (erl_lint.erl:1521)
  in call from erl_lint:all_behaviour_callbacks/3 (erl_lint.erl:1477)
  in call from erl_lint:behaviour_check/2 (erl_lint.erl:1463)
  in call from lists:foldl/3 (lists.erl:2465)
  in call from erl_lint:module/3 (erl_lint.erl:892)
  in call from compile:lint_module/2 (compile.erl:2299)

To Reproduce

-behaviour(x/2).

https://godbolt.org/z/MGhGGe3e4

Expected behavior

<source>:1:12: bad attribute
%    1| -behaviour(x/2).
%     |            ^

Affected versions
All that I have tested, including

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions