{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/3371","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3371/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3371/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3371/events","html_url":"https://github.com/elixir-lang/elixir/issues/3371","id":83755287,"number":3371,"title":"referencing namespaced module by name","user":{"login":"sunaku","id":9863,"avatar_url":"https://avatars.githubusercontent.com/u/9863?v=3","gravatar_id":"","url":"https://api.github.com/users/sunaku","html_url":"https://github.com/sunaku","followers_url":"https://api.github.com/users/sunaku/followers","following_url":"https://api.github.com/users/sunaku/following{/other_user}","gists_url":"https://api.github.com/users/sunaku/gists{/gist_id}","starred_url":"https://api.github.com/users/sunaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunaku/subscriptions","organizations_url":"https://api.github.com/users/sunaku/orgs","repos_url":"https://api.github.com/users/sunaku/repos","events_url":"https://api.github.com/users/sunaku/events{/privacy}","received_events_url":"https://api.github.com/users/sunaku/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-02T00:11:20Z","updated_at":"2015-06-02T05:37:16Z","closed_at":"2015-06-02T01:55:29Z","body":"Hello,\r\n\r\nI'm using Elixir 1.0.4 and I find that namespaced modules cannot be referenced by name unless you alias them.  For instance, in the code example below, `Foo` always references the top-level module named `Foo` , whereas I have to first `alias Foo.Bar`  in order to make `Bar` reference itself as a namespaced module.\r\n\r\nIs this a bug? :sweat_smile:  Thanks for your consideration.\r\n\r\n```sh\r\n$ cat foobar.exs\r\ndefmodule Foo.Bar do\r\n  def whoami, do: Bar\r\n  alias __MODULE__\r\n  def whoami2, do: Bar\r\nend\r\n\r\nIO.puts Foo.Bar.whoami\r\nIO.puts Foo.Bar.whoami2\r\n\r\ndefmodule Foo do\r\n  def whoami, do: Foo\r\n  alias __MODULE__\r\n  def whoami2, do: Foo\r\nend\r\n\r\nIO.puts Foo.whoami\r\nIO.puts Foo.whoami2\r\n\r\n$ elixir foobar.exs\r\nElixir.Bar\r\nElixir.Foo.Bar\r\nElixir.Foo\r\nElixir.Foo\r\n```"},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/107813099","html_url":"https://github.com/elixir-lang/elixir/issues/3371#issuecomment-107813099","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3371","id":107813099,"user":{"login":"sunaku","id":9863,"avatar_url":"https://avatars.githubusercontent.com/u/9863?v=3","gravatar_id":"","url":"https://api.github.com/users/sunaku","html_url":"https://github.com/sunaku","followers_url":"https://api.github.com/users/sunaku/followers","following_url":"https://api.github.com/users/sunaku/following{/other_user}","gists_url":"https://api.github.com/users/sunaku/gists{/gist_id}","starred_url":"https://api.github.com/users/sunaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunaku/subscriptions","organizations_url":"https://api.github.com/users/sunaku/orgs","repos_url":"https://api.github.com/users/sunaku/repos","events_url":"https://api.github.com/users/sunaku/events{/privacy}","received_events_url":"https://api.github.com/users/sunaku/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T05:37:16Z","updated_at":"2015-06-02T05:37:16Z","body":":+1: Cool, thanks for clarifying. :sweat_smile:"}}