Warn if variable is used as function call

92 views
Skip to first unread message

Aleksei Magusev

unread,
Jul 21, 2015, 9:32:55 AM7/21/15
to elixir-l...@googlegroups.com
Hey folks,

This is a followup on the https://github.com/elixir-lang/elixir/issues/3268 issue.

The impact on Elixir itself is the following:
Mostly warnings for self, group_leader and some other calls.

Ecto output with this patch:
Only 6 warnings: 2 for self call.

Phoenix output with this patch:
28 warnings: 9 for self call.

What does everyone think about this change?

Ben Wilson

unread,
Jul 21, 2015, 10:06:47 AM7/21/15
to elixir-l...@googlegroups.com
Is it possible to detect when a zero arity function is shadowed by a local variable and just warn about that?

Aleksei Magusev

unread,
Jul 21, 2015, 3:39:08 PM7/21/15
to elixir-lang-core
It's possible, however It'll be other type of warning.
E.g. self = self() will warn in this case, but not with the current patch.
Reply all
Reply to author
Forward
0 new messages