{"action":"opened","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/26371","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/26371/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/26371/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/26371/events","html_url":"https://github.com/dart-lang/sdk/issues/26371","id":152203707,"number":26371,"title":"Js-interop: cannot declare annotated functions that have callbacks properly","user":{"login":"denis-aes","id":1312112,"avatar_url":"https://avatars.githubusercontent.com/u/1312112?v=3","gravatar_id":"","url":"https://api.github.com/users/denis-aes","html_url":"https://github.com/denis-aes","followers_url":"https://api.github.com/users/denis-aes/followers","following_url":"https://api.github.com/users/denis-aes/following{/other_user}","gists_url":"https://api.github.com/users/denis-aes/gists{/gist_id}","starred_url":"https://api.github.com/users/denis-aes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denis-aes/subscriptions","organizations_url":"https://api.github.com/users/denis-aes/orgs","repos_url":"https://api.github.com/users/denis-aes/repos","events_url":"https://api.github.com/users/denis-aes/events{/privacy}","received_events_url":"https://api.github.com/users/denis-aes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-01T15:02:09Z","updated_at":"2016-05-01T15:02:09Z","closed_at":null,"body":"I'm using node.js API from compiled Dart app. With package:js bindings for this api's:\r\n\r\n```\r\n    @JS('http')\r\n    library http;\r\n    import \"package:js/js.dart\";\r\n\r\n    external Server createServer(\r\n[ void requestListener(IncomingMessage request, ServerResponse response)])\r\n```\r\n\r\nAnd calling this from main.dart:\r\n\r\n```\r\nimport \"package:js/js.dart\";\r\nimport \"node_partly.dart\" as http;\r\n\r\nmain() async {\r\n  http.Server server = http.createServer(allowInterop(handler));\r\n  server.listen(9876);\r\n}\r\n\r\nvoid handler(http.IncomingMessage request, http.ServerResponse response){\r\n  response.write(\"Hello, from dart server! \\n\");\r\n  response.write(\"You asked for ${request.url}\");\r\n  response.end();\r\n}\r\n```\r\nEverything works fine.\r\n\r\nBut. Analyzer fails with error\r\n\r\n> WARNING: The argument type 'JSFunction' cannot be assigned to the parameter type '(IncomingMessage, ServerResponse) → void'. ( example/main.dart:5)\r\n> The problem is that allowInterop produces \"JSFunction\" - deprecated class for internal use.\r\n\r\nAnd from point of view of annotations - there should be normal \"Function\" class.\r\n\r\nThis is annoying if to pay attention to this. And if I will not pay attention to analyzer errors - I may leave real error in my code.\r\n\r\nHow can I fix it?\r\n\r\nP.S. Using latest dart 1.16"}}