{"action":"created","issue":{"url":"https://api.github.com/repos/dry-rb/dry-auto_inject/issues/12","repository_url":"https://api.github.com/repos/dry-rb/dry-auto_inject","labels_url":"https://api.github.com/repos/dry-rb/dry-auto_inject/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/dry-rb/dry-auto_inject/issues/12/comments","events_url":"https://api.github.com/repos/dry-rb/dry-auto_inject/issues/12/events","html_url":"https://github.com/dry-rb/dry-auto_inject/issues/12","id":153735943,"number":12,"title":"Error when a parent class recieves arbitrary number of arguments and a parent of the parent is not","user":{"login":"flash-gordon","id":802486,"avatar_url":"https://avatars.githubusercontent.com/u/802486?v=3","gravatar_id":"","url":"https://api.github.com/users/flash-gordon","html_url":"https://github.com/flash-gordon","followers_url":"https://api.github.com/users/flash-gordon/followers","following_url":"https://api.github.com/users/flash-gordon/following{/other_user}","gists_url":"https://api.github.com/users/flash-gordon/gists{/gist_id}","starred_url":"https://api.github.com/users/flash-gordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flash-gordon/subscriptions","organizations_url":"https://api.github.com/users/flash-gordon/orgs","repos_url":"https://api.github.com/users/flash-gordon/repos","events_url":"https://api.github.com/users/flash-gordon/events{/privacy}","received_events_url":"https://api.github.com/users/flash-gordon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-09T09:25:03Z","updated_at":"2016-05-09T11:09:54Z","closed_at":null,"body":"It's better to show on modules actually:\r\n```ruby\r\nmodule Shiny\r\n  def initialize(*)\r\n    super\r\n    @foo = 1\r\n  end\r\nend\r\n\r\nInject = Dry::AutoInject(one: 1)\r\n\r\nclass Foo\r\n  include Shiny\r\n  include Inject[:one]\r\nend\r\n\r\nFoo.new\r\n\r\n__END__\r\n[8] pry(main)> wtf?\r\nException: ArgumentError: wrong number of arguments (given 1, expected 0)\r\n--\r\n0: (pry):3:in `initialize'\r\n1: (pry):3:in `initialize'\r\n2: /Users/gordon/dev/dry-auto_inject/lib/dry/auto_inject/injection.rb:123:in `initialize'\r\n```\r\n\r\n@timriley do you think the case is valid? I think about removing all injected arguments prior to call super method as a default behavior, what do you think?\r\n\r\nOh, and one more issue. Currently `.new` [accepts](https://github.com/dry-rb/dry-auto_inject/blob/master/lib/dry/auto_inject/injection.rb#L67) arbitrary number of arguments but silently ignores superfluous. "},"comment":{"url":"https://api.github.com/repos/dry-rb/dry-auto_inject/issues/comments/217837061","html_url":"https://github.com/dry-rb/dry-auto_inject/issues/12#issuecomment-217837061","issue_url":"https://api.github.com/repos/dry-rb/dry-auto_inject/issues/12","id":217837061,"user":{"login":"flash-gordon","id":802486,"avatar_url":"https://avatars.githubusercontent.com/u/802486?v=3","gravatar_id":"","url":"https://api.github.com/users/flash-gordon","html_url":"https://github.com/flash-gordon","followers_url":"https://api.github.com/users/flash-gordon/followers","following_url":"https://api.github.com/users/flash-gordon/following{/other_user}","gists_url":"https://api.github.com/users/flash-gordon/gists{/gist_id}","starred_url":"https://api.github.com/users/flash-gordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flash-gordon/subscriptions","organizations_url":"https://api.github.com/users/flash-gordon/orgs","repos_url":"https://api.github.com/users/flash-gordon/repos","events_url":"https://api.github.com/users/flash-gordon/events{/privacy}","received_events_url":"https://api.github.com/users/flash-gordon/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T11:09:54Z","updated_at":"2016-05-09T11:09:54Z","body":"It's worth to mention about one more case:\r\n```ruby\r\n[1] pry(main)> Inject = Dry::AutoInject(one: 1, two: 2)\r\n=> #<Dry::AutoInject::Injector:0x007f999281eda8 @container={:one=>1, :two=>2}, @options={}>\r\n[2] pry(main)> class Foo\r\n[2] pry(main)*   include Inject[:one]\r\n[2] pry(main)* end\r\n=> Foo\r\n[3] pry(main)> class Bar < Foo\r\n[3] pry(main)*   include Inject[:two]\r\n[3] pry(main)* end\r\n=> Bar\r\n[4] pry(main)> Bar.new\r\n=> #<Bar:0x007f9993321de0 @one=2, @two=2> \r\n[5] pry(main)>\r\n```\r\n:)\r\n"}}