{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/27097","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/27097/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/27097/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/27097/events","html_url":"https://github.com/dart-lang/sdk/issues/27097","id":171711085,"number":27097,"title":"Function doesn't implement toString in strong mode","user":{"login":"bwilkerson","id":5840555,"avatar_url":"https://avatars.githubusercontent.com/u/5840555?v=3","gravatar_id":"","url":"https://api.github.com/users/bwilkerson","html_url":"https://github.com/bwilkerson","followers_url":"https://api.github.com/users/bwilkerson/followers","following_url":"https://api.github.com/users/bwilkerson/following{/other_user}","gists_url":"https://api.github.com/users/bwilkerson/gists{/gist_id}","starred_url":"https://api.github.com/users/bwilkerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwilkerson/subscriptions","organizations_url":"https://api.github.com/users/bwilkerson/orgs","repos_url":"https://api.github.com/users/bwilkerson/repos","events_url":"https://api.github.com/users/bwilkerson/events{/privacy}","received_events_url":"https://api.github.com/users/bwilkerson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/analyzer-strong-mode","name":"analyzer-strong-mode","color":"d4c5f9"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-analyzer","name":"area-analyzer","color":"c7def8"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/P1%20high","name":"P1 high","color":"eb6420"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Type:%20bug","name":"Type: bug","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"bwilkerson","id":5840555,"avatar_url":"https://avatars.githubusercontent.com/u/5840555?v=3","gravatar_id":"","url":"https://api.github.com/users/bwilkerson","html_url":"https://github.com/bwilkerson","followers_url":"https://api.github.com/users/bwilkerson/followers","following_url":"https://api.github.com/users/bwilkerson/following{/other_user}","gists_url":"https://api.github.com/users/bwilkerson/gists{/gist_id}","starred_url":"https://api.github.com/users/bwilkerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwilkerson/subscriptions","organizations_url":"https://api.github.com/users/bwilkerson/orgs","repos_url":"https://api.github.com/users/bwilkerson/repos","events_url":"https://api.github.com/users/bwilkerson/events{/privacy}","received_events_url":"https://api.github.com/users/bwilkerson/received_events","type":"User","site_admin":false},"assignees":[{"login":"bwilkerson","id":5840555,"avatar_url":"https://avatars.githubusercontent.com/u/5840555?v=3","gravatar_id":"","url":"https://api.github.com/users/bwilkerson","html_url":"https://github.com/bwilkerson","followers_url":"https://api.github.com/users/bwilkerson/followers","following_url":"https://api.github.com/users/bwilkerson/following{/other_user}","gists_url":"https://api.github.com/users/bwilkerson/gists{/gist_id}","starred_url":"https://api.github.com/users/bwilkerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwilkerson/subscriptions","organizations_url":"https://api.github.com/users/bwilkerson/orgs","repos_url":"https://api.github.com/users/bwilkerson/repos","events_url":"https://api.github.com/users/bwilkerson/events{/privacy}","received_events_url":"https://api.github.com/users/bwilkerson/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dart-lang/sdk/milestones/41","html_url":"https://github.com/dart-lang/sdk/milestones/1.19","labels_url":"https://api.github.com/repos/dart-lang/sdk/milestones/41/labels","id":1868106,"number":41,"title":"1.19","description":"","creator":{"login":"kevmoo","id":17034,"avatar_url":"https://avatars.githubusercontent.com/u/17034?v=3","gravatar_id":"","url":"https://api.github.com/users/kevmoo","html_url":"https://github.com/kevmoo","followers_url":"https://api.github.com/users/kevmoo/followers","following_url":"https://api.github.com/users/kevmoo/following{/other_user}","gists_url":"https://api.github.com/users/kevmoo/gists{/gist_id}","starred_url":"https://api.github.com/users/kevmoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevmoo/subscriptions","organizations_url":"https://api.github.com/users/kevmoo/orgs","repos_url":"https://api.github.com/users/kevmoo/repos","events_url":"https://api.github.com/users/kevmoo/events{/privacy}","received_events_url":"https://api.github.com/users/kevmoo/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":14,"state":"open","created_at":"2016-07-06T17:05:14Z","updated_at":"2016-08-17T17:10:52Z","due_on":"2016-08-17T00:00:00Z","closed_at":null},"comments":1,"created_at":"2016-08-17T17:10:52Z","updated_at":"2016-08-17T17:12:29Z","closed_at":null,"body":"Analyze the following in strong mode:\r\n\r\n```\r\ntypedef bool Predicate<T>(T object);\r\n\r\nvoid f(Predicate<int> p) {\r\n  print(p.toString());\r\n}\r\n```\r\n\r\nThis should not produce any errors, but generates:\r\n\r\nERROR: The method 'toString' is not defined for the class 'Function'. (test.dart:19)"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/240480442","html_url":"https://github.com/dart-lang/sdk/issues/27097#issuecomment-240480442","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/27097","id":240480442,"user":{"login":"jmesserly","id":1081711,"avatar_url":"https://avatars.githubusercontent.com/u/1081711?v=3","gravatar_id":"","url":"https://api.github.com/users/jmesserly","html_url":"https://github.com/jmesserly","followers_url":"https://api.github.com/users/jmesserly/followers","following_url":"https://api.github.com/users/jmesserly/following{/other_user}","gists_url":"https://api.github.com/users/jmesserly/gists{/gist_id}","starred_url":"https://api.github.com/users/jmesserly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmesserly/subscriptions","organizations_url":"https://api.github.com/users/jmesserly/orgs","repos_url":"https://api.github.com/users/jmesserly/repos","events_url":"https://api.github.com/users/jmesserly/events{/privacy}","received_events_url":"https://api.github.com/users/jmesserly/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T17:12:28Z","updated_at":"2016-08-17T17:12:28Z","body":"Probably caused by https://github.com/dart-lang/sdk/commit/efa73a440e66364abd1b278a27c245d724c760e5\r\n\r\nRelated open bug: https://github.com/dart-lang/sdk/issues/27050\r\n\r\nWhat happens is element_resolver often treats any FunctionType as \"Function\" -- this is bad for strong mode because it leads to soundness problems and other loss of type information.\r\n\r\nBut unfortunately I don't think the system understands that FunctionTypes still inherit from \"Object\" and thus should support calling those methods. It is probably a simple fix to \"_resolveInvokedElementWithTarget\".\r\n\r\n(Aside: in general I wish we understood better during resolution that Object methods are on anything. We have some other strong mode logic to work around this, e.g. even when the target is \"dynamic\" we can usuall resolve the Object methods/getters)."}}
{"actor":{"display_login":"jmesserly"}}