{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/5461","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5461/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5461/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5461/events","html_url":"https://github.com/elixir-lang/elixir/issues/5461","id":190189772,"number":5461,"title":"Revisit warnings to be errors","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"labels":[{"id":17739153,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App:Elixir","name":"App:Elixir","color":"CCCCCC","default":false},{"id":207979,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind:Chore","name":"Kind:Chore","color":"fbca04","default":false},{"id":778790,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Note:Discussion","name":"Note:Discussion","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/elixir-lang/elixir/milestones/19","html_url":"https://github.com/elixir-lang/elixir/milestones/v2.0.0","labels_url":"https://api.github.com/repos/elixir-lang/elixir/milestones/19/labels","id":1889114,"number":19,"title":"v2.0.0","description":"","creator":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-07-18T10:36:08Z","updated_at":"2016-11-17T23:00:36Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-11-17T23:00:36Z","updated_at":"2016-11-17T23:17:55Z","closed_at":null,"body":"In this issue, we will keep a list of warnings that we would like to make errors for Elixir v2.0. For now, we will try to have a single thread that lists all of them, but if we cannot manage the discussion, we can break it apart.\r\n\r\nIt is worth reiterating our compromise with warnings: many places we could error we raise warnings so users can get more feedback on each compilation and we don't allow warnings to be disabled. On the other hand, we promise that every warning will be worth of your time.\r\n\r\nThe downside of this approach, however, is that folks not always pay attention to warnings and the \"getting more feedback on each compilation\" is less relevant today than it was 2 years ago since Mix is quite smart when it comes to compiling your code.\r\n\r\nNote we won't mention warnings that are raised because of deprecated features. Those, by definition, will raise on 2.0.\r\n\r\n## Will raise\r\n\r\n  * [ ] \"undefined module attribute @var\" should raise\r\n\r\n## Will continue as warning\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/261400938","html_url":"https://github.com/elixir-lang/elixir/issues/5461#issuecomment-261400938","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5461","id":261400938,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T23:17:55Z","updated_at":"2016-11-17T23:17:55Z","body":"I would like to discuss what we will do with:\r\n\r\n> variable \"foo\" does not exist and is being expanded to \"foo()\", please use parentheses to remove the ambiguity or change the variable name\r\n\r\nIf the function call or the variable also does not exist, an error will be raised anyway. Given parentheses are optional everywhere else, an error may be too imposing,  is a warning the correct decision here? That's my inclination.\r\n\r\n> the variable \"foo\" is unsafe as it has been set inside a case/cond/receive/if/&&/||\r\n\r\nToday this is a warning and the value set inside the case/cond/receive/if/&&/|| leaks out. On 2.0, we are going to change this behaviour so the variable no longer leaks. We still need to decide what we want to do for those cases:\r\n\r\n  1. warn\r\n  2. error\r\n  3. do nothing\r\n\r\nOne thing to have in mind is that folks will write code like this:\r\n\r\n```elixir\r\nx = 1\r\nif true do\r\n  x = 2\r\nend\r\nx #=> 1\r\n```\r\n\r\nand it may be surprising if we don't warn or error. On the other hand, the language was designed to work as above, so why warn/error? Furthermore, we can already write code like this:\r\n\r\n```elixir\r\nx = 1\r\n(fn ->\r\n  x = 2\r\nend).()\r\nx #=> 1\r\n```\r\n\r\nand the code above *does not warn nor error*. If we want to make it a warning or error, it would be nice to do so consistently throughout the language.\r\n"}}
{"actor":{"display_login":"josevalim"}}