{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/40600759","id":40600759,"diff_hunk":"@@ -2176,17 +2176,17 @@ defmodule Kernel do\n       true ->\n         raise ArgumentError, \"cannot set attribute @#{name} inside function/macro\"\n       false ->\n-        arg = case name do\n-          :behavior ->\n+        cond do\n+          name == :behavior ->\n             :elixir_errors.warn env.line, env.file,\n                                 \"@behavior attribute is not supported, please use @behaviour instead\"\n-          :doc       -> {env.line, arg}\n-          :typedoc   -> {env.line, arg}\n-          :moduledoc -> {env.line, arg}\n-          _          -> arg\n+          :lists.member(name, [:moduledoc, :typedoc, :doc]) ->\n+            stack = env_stacktrace(env)\n+            arg   = {env.line, arg}\n+            quote do: Module.put_attribute(__MODULE__, unquote(name), unquote(arg), unquote(stack))","path":"lib/elixir/lib/kernel.ex","position":17,"original_position":17,"commit_id":"e4552981a73208340f1bd5006d798e37f6b7dbdd","original_commit_id":"e4552981a73208340f1bd5006d798e37f6b7dbdd","user":{"login":"danielberkompas","id":1186992,"avatar_url":"https://avatars.githubusercontent.com/u/1186992?v=3","gravatar_id":"","url":"https://api.github.com/users/danielberkompas","html_url":"https://github.com/danielberkompas","followers_url":"https://api.github.com/users/danielberkompas/followers","following_url":"https://api.github.com/users/danielberkompas/following{/other_user}","gists_url":"https://api.github.com/users/danielberkompas/gists{/gist_id}","starred_url":"https://api.github.com/users/danielberkompas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielberkompas/subscriptions","organizations_url":"https://api.github.com/users/danielberkompas/orgs","repos_url":"https://api.github.com/users/danielberkompas/repos","events_url":"https://api.github.com/users/danielberkompas/events{/privacy}","received_events_url":"https://api.github.com/users/danielberkompas/received_events","type":"User","site_admin":false},"body":"@josevalim I've attempted to consolidate things here and pass only the stacktrace. However, passing the stack trace seems to cause an error when bootstrapping the `File` module:\r\n\r\n```\r\nCompiled lib/elixir/lib/path.ex\r\nerror: #{'__exception__' => true,\r\n         '__struct__' => 'Elixir.CompileError',\r\n         description => <<\"invalid quoted expression: {File, :__MODULE__, 0, [file: \\\"lib/elixir/lib/file.ex\\\", line: 2]}\">>,\r\n         file => <<\"/Users/dberkom/dev/elixir/lib/elixir/lib/file.ex\">>,\r\n         line => 0}\r\nstacktrace: [{'Elixir.Kernel','@',1,[{file,\"expanding macro\"}]},\r\n             {'Elixir.File','__MODULE__',0,\r\n                            [{file,\"/Users/dberkom/dev/elixir/lib/elixir/lib/file.ex\"},\r\n                             {line,2}]},\r\n             {elixir,erl_eval,3,[{file,\"src/elixir.erl\"},{line,198}]},\r\n             {elixir,eval_forms,4,[{file,\"src/elixir.erl\"},{line,186}]},\r\n             {elixir_compiler,eval_compilation,3,\r\n                              [{file,\"src/elixir_compiler.erl\"},{line,66}]},\r\n             {elixir_compiler,quoted,3,\r\n                              [{file,\"src/elixir_compiler.erl\"},{line,30}]},\r\n             {elixir_compiler,core_file,1,\r\n                              [{file,\"src/elixir_compiler.erl\"},{line,218}]},\r\n             {elixir_compiler,'-core/0-lc$^0/1-0-',1,\r\n                              [{file,\"src/elixir_compiler.erl\"},{line,214}]}]\r\nmake: *** [lib/elixir/ebin/Elixir.Kernel.beam] Error 1\r\n```","created_at":"2015-09-28T20:25:28Z","updated_at":"2015-09-28T20:25:28Z","html_url":"https://github.com/elixir-lang/elixir/pull/3793#discussion_r40600759","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/40600759"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3793#discussion_r40600759"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793","id":46191830,"html_url":"https://github.com/elixir-lang/elixir/pull/3793","diff_url":"https://github.com/elixir-lang/elixir/pull/3793.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/3793.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3793","number":3793,"state":"open","locked":false,"title":"[#3707] Warn when @attributes are redefined","user":{"login":"danielberkompas","id":1186992,"avatar_url":"https://avatars.githubusercontent.com/u/1186992?v=3","gravatar_id":"","url":"https://api.github.com/users/danielberkompas","html_url":"https://github.com/danielberkompas","followers_url":"https://api.github.com/users/danielberkompas/followers","following_url":"https://api.github.com/users/danielberkompas/following{/other_user}","gists_url":"https://api.github.com/users/danielberkompas/gists{/gist_id}","starred_url":"https://api.github.com/users/danielberkompas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielberkompas/subscriptions","organizations_url":"https://api.github.com/users/danielberkompas/orgs","repos_url":"https://api.github.com/users/danielberkompas/repos","events_url":"https://api.github.com/users/danielberkompas/events{/privacy}","received_events_url":"https://api.github.com/users/danielberkompas/received_events","type":"User","site_admin":false},"body":"Attributes such as `@doc` and `@moduledoc` should emit warnings when they\r\nare redefined. For example:\r\n\r\n```elixir\r\n@doc \"first\"\r\n@doc \"second\"\r\n```\r\n\r\nThis should emit a warning to the user, because the doc tag will be\r\noverwritten with the value “second”.\r\n\r\nA couple notes about the implementation:\r\n\r\n- This implementation emits a warning whenever any non-accumulated\r\nmodule attribute is redefined, not just `@doc` and `@moduledoc`.\r\n\r\n- I had to add a caller option to the Module.put_attribute/3 function\r\nin order to report a line number and file for the warning. `__CALLER__`\r\nwas not available.\r\n\r\n- This implementation throws a lot of false positives during Elixir’s\r\nbootstrap compile phase. I’ve had trouble debugging it. I think it may\r\nbe happening because `@attributes` are treated differently during the\r\nbootstrap phase. Any help would be appreciated.\r\n\r\nSee #3707 for more details.","created_at":"2015-09-28T18:38:04Z","updated_at":"2015-09-28T20:25:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00bb6bbc1d5e63bb130deeaea3d16209a71aad94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3793/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/e4552981a73208340f1bd5006d798e37f6b7dbdd","head":{"label":"danielberkompas:3707-warn-on-redefined-docs","ref":"3707-warn-on-redefined-docs","sha":"e4552981a73208340f1bd5006d798e37f6b7dbdd","user":{"login":"danielberkompas","id":1186992,"avatar_url":"https://avatars.githubusercontent.com/u/1186992?v=3","gravatar_id":"","url":"https://api.github.com/users/danielberkompas","html_url":"https://github.com/danielberkompas","followers_url":"https://api.github.com/users/danielberkompas/followers","following_url":"https://api.github.com/users/danielberkompas/following{/other_user}","gists_url":"https://api.github.com/users/danielberkompas/gists{/gist_id}","starred_url":"https://api.github.com/users/danielberkompas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielberkompas/subscriptions","organizations_url":"https://api.github.com/users/danielberkompas/orgs","repos_url":"https://api.github.com/users/danielberkompas/repos","events_url":"https://api.github.com/users/danielberkompas/events{/privacy}","received_events_url":"https://api.github.com/users/danielberkompas/received_events","type":"User","site_admin":false},"repo":{"id":43318970,"name":"elixir","full_name":"danielberkompas/elixir","owner":{"login":"danielberkompas","id":1186992,"avatar_url":"https://avatars.githubusercontent.com/u/1186992?v=3","gravatar_id":"","url":"https://api.github.com/users/danielberkompas","html_url":"https://github.com/danielberkompas","followers_url":"https://api.github.com/users/danielberkompas/followers","following_url":"https://api.github.com/users/danielberkompas/following{/other_user}","gists_url":"https://api.github.com/users/danielberkompas/gists{/gist_id}","starred_url":"https://api.github.com/users/danielberkompas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielberkompas/subscriptions","organizations_url":"https://api.github.com/users/danielberkompas/orgs","repos_url":"https://api.github.com/users/danielberkompas/repos","events_url":"https://api.github.com/users/danielberkompas/events{/privacy}","received_events_url":"https://api.github.com/users/danielberkompas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielberkompas/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":true,"url":"https://api.github.com/repos/danielberkompas/elixir","forks_url":"https://api.github.com/repos/danielberkompas/elixir/forks","keys_url":"https://api.github.com/repos/danielberkompas/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielberkompas/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielberkompas/elixir/teams","hooks_url":"https://api.github.com/repos/danielberkompas/elixir/hooks","issue_events_url":"https://api.github.com/repos/danielberkompas/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/danielberkompas/elixir/events","assignees_url":"https://api.github.com/repos/danielberkompas/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/danielberkompas/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/danielberkompas/elixir/tags","blobs_url":"https://api.github.com/repos/danielberkompas/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielberkompas/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielberkompas/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielberkompas/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielberkompas/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/danielberkompas/elixir/languages","stargazers_url":"https://api.github.com/repos/danielberkompas/elixir/stargazers","contributors_url":"https://api.github.com/repos/danielberkompas/elixir/contributors","subscribers_url":"https://api.github.com/repos/danielberkompas/elixir/subscribers","subscription_url":"https://api.github.com/repos/danielberkompas/elixir/subscription","commits_url":"https://api.github.com/repos/danielberkompas/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielberkompas/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielberkompas/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielberkompas/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielberkompas/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/danielberkompas/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielberkompas/elixir/merges","archive_url":"https://api.github.com/repos/danielberkompas/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielberkompas/elixir/downloads","issues_url":"https://api.github.com/repos/danielberkompas/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/danielberkompas/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/danielberkompas/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/danielberkompas/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielberkompas/elixir/labels{/name}","releases_url":"https://api.github.com/repos/danielberkompas/elixir/releases{/id}","created_at":"2015-09-28T18:28:22Z","updated_at":"2015-09-28T18:28:28Z","pushed_at":"2015-09-28T20:24:23Z","git_url":"git://github.com/danielberkompas/elixir.git","ssh_url":"git@github.com:danielberkompas/elixir.git","clone_url":"https://github.com/danielberkompas/elixir.git","svn_url":"https://github.com/danielberkompas/elixir","homepage":"http://elixir-lang.org/","size":51315,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"293933b813d0b4cb8a3a0ad1fb041e4a748b0890","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","created_at":"2011-01-09T08:43:57Z","updated_at":"2015-09-28T19:34:28Z","pushed_at":"2015-09-28T20:24:24Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":51315,"stargazers_count":4965,"watchers_count":4965,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":672,"mirror_url":null,"open_issues_count":51,"forks":672,"open_issues":51,"watchers":4965,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3793"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3793"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3793/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3793/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/e4552981a73208340f1bd5006d798e37f6b7dbdd"}}}}