{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-library/issues/771","repository_url":"https://api.github.com/repos/google/closure-library","labels_url":"https://api.github.com/repos/google/closure-library/issues/771/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-library/issues/771/comments","events_url":"https://api.github.com/repos/google/closure-library/issues/771/events","html_url":"https://github.com/google/closure-library/issues/771","id":191222425,"number":771,"title":"Object type is not inferred from multimap","user":{"login":"naamaamir","id":23481639,"avatar_url":"https://avatars.githubusercontent.com/u/23481639?v=3","gravatar_id":"","url":"https://api.github.com/users/naamaamir","html_url":"https://github.com/naamaamir","followers_url":"https://api.github.com/users/naamaamir/followers","following_url":"https://api.github.com/users/naamaamir/following{/other_user}","gists_url":"https://api.github.com/users/naamaamir/gists{/gist_id}","starred_url":"https://api.github.com/users/naamaamir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naamaamir/subscriptions","organizations_url":"https://api.github.com/users/naamaamir/orgs","repos_url":"https://api.github.com/users/naamaamir/repos","events_url":"https://api.github.com/users/naamaamir/events{/privacy}","received_events_url":"https://api.github.com/users/naamaamir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T09:31:49Z","updated_at":"2016-11-28T20:48:57Z","closed_at":null,"body":"Hi,\r\n\r\nI have this multimap with callback functions.\r\nWhen I compile I get \"expressions are not callable\" error.\r\n\r\nCode example:\r\n\r\n```js\r\n/** @private {!Multimap<!string,!function(!Match)>} map  */\r\nthis.map = new Multimap();\r\n// ....\r\nfor (let callback of this.map.get(key)) {\r\n  callback(match);\r\n}\r\n```\r\n\r\nThe get method returns `Array<*>` instead of `Array<!function(!Match)>`. \r\nI understand that generics should be used.\r\nI opened this issue to closure-compiler: https://github.com/google/closure-compiler/issues/2151\r\nBut I was redirected to the closure-library.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/google/closure-library/issues/comments/263389765","html_url":"https://github.com/google/closure-library/issues/771#issuecomment-263389765","issue_url":"https://api.github.com/repos/google/closure-library/issues/771","id":263389765,"user":{"login":"shicks","id":143899,"avatar_url":"https://avatars.githubusercontent.com/u/143899?v=3","gravatar_id":"","url":"https://api.github.com/users/shicks","html_url":"https://github.com/shicks","followers_url":"https://api.github.com/users/shicks/followers","following_url":"https://api.github.com/users/shicks/following{/other_user}","gists_url":"https://api.github.com/users/shicks/gists{/gist_id}","starred_url":"https://api.github.com/users/shicks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shicks/subscriptions","organizations_url":"https://api.github.com/users/shicks/orgs","repos_url":"https://api.github.com/users/shicks/repos","events_url":"https://api.github.com/users/shicks/events{/privacy}","received_events_url":"https://api.github.com/users/shicks/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T20:48:57Z","updated_at":"2016-11-28T20:48:57Z","body":"The main problem in your code is that `Multimap<function(!Match)>` is nonsense since `Multimap` is not declared with `@template`.  The compiler should probably have a warning for using template paramaters for non-template types (it was impossible when generics were first added since there were so many spurious/incorrect usages, but now that's it's been there for years, this may be feasible).\r\n\r\nBut Dimitris is right that the \"correct\" solution would be to add the `@template`.  This should be possible, but `goog.structs` and `goog.labs.structs` are both basically in maintenance mode, since we are working on a cleaner and more coherent collections library.  If you want to try to add the generics and properly type the methods, feel free to send a PR."}}
{"actor":{"display_login":"shicks"}}