{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/2979","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/2979/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/2979/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/2979/events","html_url":"https://github.com/elixir-lang/elixir/issues/2979","id":53257331,"number":2979,"title":"Specifying nil in dependency specification does not produce an error","user":{"login":"alco","id":207748,"avatar_url":"https://avatars.githubusercontent.com/u/207748?v=3","gravatar_id":"","url":"https://api.github.com/users/alco","html_url":"https://github.com/alco","followers_url":"https://api.github.com/users/alco/followers","following_url":"https://api.github.com/users/alco/following{/other_user}","gists_url":"https://api.github.com/users/alco/gists{/gist_id}","starred_url":"https://api.github.com/users/alco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alco/subscriptions","organizations_url":"https://api.github.com/users/alco/orgs","repos_url":"https://api.github.com/users/alco/repos","events_url":"https://api.github.com/users/alco/events{/privacy}","received_events_url":"https://api.github.com/users/alco/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App%3AMix","name":"App:Mix","color":"CCCCCC"},{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind%3ABug","name":"Kind:Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-02T15:13:13Z","updated_at":"2015-01-03T01:42:27Z","closed_at":null,"body":"The following example shows that we get an error about an invalid dep specification.\r\n```elixir\r\n# mix.exs\r\ndefp deps do\r\n  [{:porcelain}]\r\nend\r\n```\r\n```\r\nλ mix deps\r\n** (Mix) Dependency specified in the wrong format:\r\n\r\n    {:porcelain}\r\n\r\nExpected:\r\n\r\n    {app, opts} | {app, requirement} | {app, requirement, opts}\r\n\r\nWhere:\r\n\r\n    app :: atom\r\n    requirement :: String.t | Regex.t\r\n    opts :: Keyword.t\r\n```\r\n\r\nWe can see that `{app, opts}` is a valid format where `opts` is a keyword. Yet, when we provide `nil` instead of a keyword, no error is emitted:\r\n\r\n```elixir\r\ndefp deps do\r\n  [{:porcelain, nil}]\r\nend\r\n```\r\n```\r\nλ mix deps\r\n* porcelain (Hex package)\r\n  the dependency is not available, run `mix deps.get`\r\n\r\nλ mix deps.get\r\nRunning dependency resolution\r\nUnlocked:   porcelain\r\nDependency resolution completed successfully\r\n  porcelain: v2.0.0\r\n* Getting porcelain (Hex package)\r\nChecking package (https://s3.amazonaws.com/s3.hex.pm/tarballs/porcelain-2.0.0.tar)\r\nUsing locally cached package\r\nUnpacked package tarball (/Users/alco/.hex/packages/porcelain-2.0.0.tar)\r\n```\r\n\r\nThe spec above is parsed as `{app, nil, []}`. This should produce an error because the version requirement is neither a string nor a regex here."},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/68578788","html_url":"https://github.com/elixir-lang/elixir/issues/2979#issuecomment-68578788","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/2979","id":68578788,"user":{"login":"ericmj","id":316890,"avatar_url":"https://avatars.githubusercontent.com/u/316890?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmj","html_url":"https://github.com/ericmj","followers_url":"https://api.github.com/users/ericmj/followers","following_url":"https://api.github.com/users/ericmj/following{/other_user}","gists_url":"https://api.github.com/users/ericmj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmj/subscriptions","organizations_url":"https://api.github.com/users/ericmj/orgs","repos_url":"https://api.github.com/users/ericmj/repos","events_url":"https://api.github.com/users/ericmj/events{/privacy}","received_events_url":"https://api.github.com/users/ericmj/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T01:42:26Z","updated_at":"2015-01-03T01:42:26Z","body":"It can be nil internally and we support `{:ecto, []}` which is the same thing as `{:ecto, nil, []}` so I don't see any reason to limit it. I don't have strong opinions about this though."}}