{"action":"created","issue":{"url":"https://api.github.com/repos/zserge/anvil/issues/14","labels_url":"https://api.github.com/repos/zserge/anvil/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/zserge/anvil/issues/14/comments","events_url":"https://api.github.com/repos/zserge/anvil/issues/14/events","html_url":"https://github.com/zserge/anvil/issues/14","id":78517266,"number":14,"title":"Overload resolution ambiguity with adapter(RenderableArrayAdapter)","user":{"login":"corbt","id":176426,"avatar_url":"https://avatars.githubusercontent.com/u/176426?v=3","gravatar_id":"","url":"https://api.github.com/users/corbt","html_url":"https://github.com/corbt","followers_url":"https://api.github.com/users/corbt/followers","following_url":"https://api.github.com/users/corbt/following{/other_user}","gists_url":"https://api.github.com/users/corbt/gists{/gist_id}","starred_url":"https://api.github.com/users/corbt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corbt/subscriptions","organizations_url":"https://api.github.com/users/corbt/orgs","repos_url":"https://api.github.com/users/corbt/repos","events_url":"https://api.github.com/users/corbt/events{/privacy}","received_events_url":"https://api.github.com/users/corbt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-20T13:05:51Z","updated_at":"2015-05-26T11:35:56Z","closed_at":null,"body":"I have the following test activity in kotlin that is causing an error that appears to be related to the implementation of `RenderableArrayAdapter`:\r\n\r\n```kotlin\r\nimport android.app.Activity\r\nimport android.os.Bundle\r\n\r\nimport android.content.Context;\r\nimport android.util.Log\r\nimport android.widget.Button;\r\nimport android.widget.LinearLayout;\r\nimport android.widget.ListView\r\nimport android.widget.TextView;\r\nimport trikita.anvil.RenderableView;\r\n\r\nimport trikita.anvil.RenderableView;\r\nimport trikita.anvil.BaseAttrs.*;\r\nimport trikita.anvil.Nodes\r\nimport trikita.anvil.RenderableArrayAdapter\r\nimport trikita.anvil.v10.Attrs.*;\r\n\r\nclass UsersList: Activity() {\r\n    override fun onCreate(b: Bundle?) {\r\n        super<Activity>.onCreate(b)\r\n\r\n        var testNames: Array<String> = array(\"Bob Jones\", \"John Black\", \"Other Name\")\r\n\r\n        setContentView(object: RenderableView(this) {\r\n            public override fun view() =\r\n                    v<LinearLayout> {\r\n                        - size(FILL, FILL)\r\n                        - orientation(LinearLayout.VERTICAL)\r\n\r\n                        v<TextView> {\r\n                            - text(\"Names\")\r\n                        }\r\n\r\n                        v<ListView> {\r\n                            adapter(object : RenderableArrayAdapter<String>(testNames) {\r\n                                override fun itemView(p0: Int, p1: String?): Nodes.ViewNode? {\r\n                                    throw UnsupportedOperationException()\r\n                                }\r\n                            })\r\n                        }\r\n                    }\r\n        });\r\n    }\r\n}\r\n```\r\n\r\nThe compiler throws the following error for the `adapter()` function call:\r\n\r\n```\r\nError:(37, 29) Overload resolution ambiguity:\r\npublic open fun adapter(arg: android.widget.ListAdapter!): trikita.anvil.Nodes.AttrNode! defined in trikita.anvil.v10.Attrs\r\npublic open fun adapter(arg: android.widget.Adapter!): trikita.anvil.Nodes.AttrNode! defined in trikita.anvil.v10.Attrs\r\npublic open fun adapter(arg: android.widget.SpinnerAdapter!): trikita.anvil.Nodes.AttrNode! defined in trikita.anvil.v10.Attrs\r\n```\r\n\r\nIt looks like this is because RenderableArrayAdapter implements ListAdapter and SpinnerAdapter (and I guess Adapter as well). But since there are different implementation bodies the method doesn't resolve. Is there something I'm doing wrong here, or should `adapter` be combined into a single method call that dispatches internally based on its argument type?"},"comment":{"url":"https://api.github.com/repos/zserge/anvil/issues/comments/105494918","html_url":"https://github.com/zserge/anvil/issues/14#issuecomment-105494918","issue_url":"https://api.github.com/repos/zserge/anvil/issues/14","id":105494918,"user":{"login":"zserge","id":1911760,"avatar_url":"https://avatars.githubusercontent.com/u/1911760?v=3","gravatar_id":"","url":"https://api.github.com/users/zserge","html_url":"https://github.com/zserge","followers_url":"https://api.github.com/users/zserge/followers","following_url":"https://api.github.com/users/zserge/following{/other_user}","gists_url":"https://api.github.com/users/zserge/gists{/gist_id}","starred_url":"https://api.github.com/users/zserge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zserge/subscriptions","organizations_url":"https://api.github.com/users/zserge/orgs","repos_url":"https://api.github.com/users/zserge/repos","events_url":"https://api.github.com/users/zserge/events{/privacy}","received_events_url":"https://api.github.com/users/zserge/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T11:35:56Z","updated_at":"2015-05-26T11:35:56Z","body":"v10 is for API level >= 10 (Android 2.3.3, 99% of the devices)\r\nv15 is for API level >= 15 (Android 4.x, 96% of the devices)\r\nI've just pushed a fix to v15, there are some new classes/methods that I forgot to blacklist during the code generation."}}