Re: [elixir-core:11627] [Proposed warning for naming a variable the name of a type] What do you think?

2024-01-12 Thread José Valim
> 1. Do you think anyone would purposefully name a variable a type? (false positives.) Yes, we do it in Elixir all the time. Because if I am implementing String.downcase/1, the name `string` is a very good name for the argument: def downcase(string) And since we use names in the docs, calling

[elixir-core:11627] [Proposed warning for naming a variable the name of a type] What do you think?

2024-01-12 Thread Robert Viragh
This proposes you should add a warning if a programmer names the variable with the name of a type - what do you think? Motivation Ahead of the recent gradual typing introduction, I was having fun exploring types and was trying to come up with cases that are definitely a type mistake but that