Skip to content

internal error in pass lint_module: no match of right hand side value on invalid function annotation #11397

Description

@lmaltsis

Describe the bug
erlc ICEs if you annotate a function with [{a/0,b/0,0}]

To Reproduce

$ cat /tmp/bug.erl
-module(program).

-compile({nowarn_unused_function,[{a/0,b/0,0}]}).
f1(_) ->
    halt().

$ erlc /tmp/bug.erl
/tmp/bug.erl: internal error in pass lint_module:
exception error: no match of right hand side value {{a,0},{b,0},0}
  in function  erl_lint:func_location_error/4 (erl_lint.erl:1956)
  in call from erl_lint:check_unused_functions/2 (erl_lint.erl:1806)
  in call from lists:foldl_1/3 (lists.erl:2470)
  in call from erl_lint:module/3 (erl_lint.erl:892)
  in call from compile:lint_module/2 (compile.erl:2299)
  in call from compile:fold_comp/4 (compile.erl:1352)
  in call from compile:internal_comp/5 (compile.erl:1327)
  in call from compile:'-internal_fun/2-anonymous-0-'/2 (compile.erl:1153)

Expected behavior
Syntax error

Affected versions
trunk: 16e8d4d
26.2.5.16: https://godbolt.org/z/nbf9GK5z5

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