{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/5351","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5351/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5351/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5351/events","html_url":"https://github.com/elixir-lang/elixir/issues/5351","id":184705007,"number":5351,"title":"literal float is not a valid typespec","user":{"login":"eksperimental","id":9133420,"avatar_url":"https://avatars.githubusercontent.com/u/9133420?v=3","gravatar_id":"","url":"https://api.github.com/users/eksperimental","html_url":"https://github.com/eksperimental","followers_url":"https://api.github.com/users/eksperimental/followers","following_url":"https://api.github.com/users/eksperimental/following{/other_user}","gists_url":"https://api.github.com/users/eksperimental/gists{/gist_id}","starred_url":"https://api.github.com/users/eksperimental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eksperimental/subscriptions","organizations_url":"https://api.github.com/users/eksperimental/orgs","repos_url":"https://api.github.com/users/eksperimental/repos","events_url":"https://api.github.com/users/eksperimental/events{/privacy}","received_events_url":"https://api.github.com/users/eksperimental/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App:Elixir","name":"App:Elixir","color":"CCCCCC"},{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind:Documentation","name":"Kind:Documentation","color":"006b75"},{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Level:Starter","name":"Level:Starter","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-23T18:10:14Z","updated_at":"2016-10-23T23:12:11Z","closed_at":null,"body":"Code:\r\n\r\n```elixir\r\n  @spec div(number, 0.0) :: no_return\r\n```\r\n\r\nwill throw:\r\n\r\n```console\r\n== Compilation error on file lib/specs.ex ==\r\n** (CompileError) lib/specs.ex:8: unexpected expression in typespec: 0.0\r\n```\r\n\r\n\r\nIn the typespecs page it is mentioned that \r\n\r\n    Literals\r\n    \r\n    The following literals are also supported in typespecs:\r\n    \r\n    type :: :atom                         ## Atoms\r\n          | 1.0                           ## Floats\r\n          | 1                             ## Integers\r\n          | 1..10                         ## Integers from 1 to 10\r\n\r\nand checking http://erlang.org/doc/reference_manual/typespec.html\r\nI see that there is nothing that tells us we can use it.\r\n\r\nI tried hacking kernel/typespec.ex adding `:float`  as a type, I guess the restriction comes from Erlang.\r\nI can submit a PR fixing the docs, \r\nbut just wanted to create an issue in case there is a way to support this."},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/255621552","html_url":"https://github.com/elixir-lang/elixir/issues/5351#issuecomment-255621552","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5351","id":255621552,"user":{"login":"eksperimental","id":9133420,"avatar_url":"https://avatars.githubusercontent.com/u/9133420?v=3","gravatar_id":"","url":"https://api.github.com/users/eksperimental","html_url":"https://github.com/eksperimental","followers_url":"https://api.github.com/users/eksperimental/followers","following_url":"https://api.github.com/users/eksperimental/following{/other_user}","gists_url":"https://api.github.com/users/eksperimental/gists{/gist_id}","starred_url":"https://api.github.com/users/eksperimental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eksperimental/subscriptions","organizations_url":"https://api.github.com/users/eksperimental/orgs","repos_url":"https://api.github.com/users/eksperimental/repos","events_url":"https://api.github.com/users/eksperimental/events{/privacy}","received_events_url":"https://api.github.com/users/eksperimental/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T23:12:11Z","updated_at":"2016-10-23T23:12:11Z","body":"@josevalim Erlang's been bitten by the same documentation bug.\r\nhttp://erlang.org/pipermail/erlang-bugs/2011-September/002576.html\r\nit makes sense why there is not such a type."}}
{"actor":{"display_login":"eksperimental"}}