Closed eksperimental closed 5 years ago
The order is rather alphabetical:
iex(1)> defmodule Foo do
...(1)> def bar(arg) do
...(1)> {a, c, b} = arg
...(1)> end
...(1)> end
warning: variable "a" is unused (if the variable is not meant to be used, prefix it with an underscore)
iex:3: Foo.bar/1
warning: variable "b" is unused (if the variable is not meant to be used, prefix it with an underscore)
iex:3: Foo.bar/1
warning: variable "c" is unused (if the variable is not meant to be used, prefix it with an underscore)
iex:3: Foo.bar/1
I am not sure if I would consider it a bug but we would need to complicate the compiler to track the order they are defined besides their name and I don't think the complexity is worth it.
Thanks for the report @eksperimental!
Environment
Current behavior
when variables are unused in the same line, the order of the warnings is given in reverse
Include code samples, errors and stacktraces if appropriate.
Expected behavior
To print the warnings in the correct order