{"action":"closed","issue":{"url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/2","labels_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/2/comments","events_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/2/events","html_url":"https://github.com/SalomonBrys/Kodein/issues/2","id":95924443,"number":2,"title":"\"No binding found\" error by generic interface","user":{"login":"k-kagurazaka","id":1316988,"avatar_url":"https://avatars.githubusercontent.com/u/1316988?v=3","gravatar_id":"","url":"https://api.github.com/users/k-kagurazaka","html_url":"https://github.com/k-kagurazaka","followers_url":"https://api.github.com/users/k-kagurazaka/followers","following_url":"https://api.github.com/users/k-kagurazaka/following{/other_user}","gists_url":"https://api.github.com/users/k-kagurazaka/gists{/gist_id}","starred_url":"https://api.github.com/users/k-kagurazaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-kagurazaka/subscriptions","organizations_url":"https://api.github.com/users/k-kagurazaka/orgs","repos_url":"https://api.github.com/users/k-kagurazaka/repos","events_url":"https://api.github.com/users/k-kagurazaka/events{/privacy}","received_events_url":"https://api.github.com/users/k-kagurazaka/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-19T15:28:54Z","updated_at":"2015-08-04T10:12:57Z","closed_at":"2015-08-04T10:12:57Z","body":"Hi,\r\n\r\nthis library looks pretty good, so it's simple, powerful and quite Kotlin like.\r\nHowever I encountered a problem when I try to inject a instance of generic interface.\r\n\r\nExample code:\r\n\r\n```kotlin\r\npublic interface Foo\r\npublic interface Bar<T>\r\npublic class FooBarImpl : Bar<Foo>\r\n\r\noverride val kodein: Kodein by lazyKodein {\r\n    bind<Bar<Foo>>() with instance(FooBarImpl())\r\n}\r\n\r\nval foobar: Bar<Foo> by injectInstance() // \"No binding found\" exception!!\r\n```\r\n\r\nThe instance of Kodein properly has the instance of FooBarImpl in its map, but binding failed.\r\nI found an uncool solution using a wrapper interface:\r\n\r\n```kotlin\r\npublic interface Foo\r\npublic interface Bar<T>\r\npublic interface FooBar : Bar<Foo>\r\npublic class FooBarImpl : FooBar\r\n\r\noverride val kodein: Kodein by lazyKodein {\r\n    bind<FooBar>() with instance(FooBarImpl())\r\n}\r\n\r\nval foobar: FooBar by injectInstance()\r\n```\r\n\r\nIt works well, but I am not a fan of the redundant interface.\r\nDo you have any ideas for solving this issue?"}}