{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/25171","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/25171/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/25171/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/25171/events","html_url":"https://github.com/dart-lang/sdk/issues/25171","id":121060159,"number":25171,"title":"strong mode's return type inference breaks in analysis_server","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},"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/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/priority-high","name":"priority-high","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-08T17:41:46Z","updated_at":"2015-12-08T18:06:42Z","closed_at":null,"body":"Ironically, this fails in our own type:\r\n```dart\r\nabstract class CoercionInfo extends StaticInfo {\r\n  // ...\r\n  toErrorCode() => new HintCode(name, message);\r\n```\r\n```\r\nInvalid override. The type of CoercionInfo.toErrorCode (() → dynamic) is not a subtype of StaticInfo.toErrorCode (() → ErrorCode). lib/src/task/strong/info.dart, line 70\r\n```\r\nThe error doesn't appear right away--it seems caused by my editing files. My guess is we're losing the \"implicit return type\" flag, since it's not tracked in the type system.\r\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/162964721","html_url":"https://github.com/dart-lang/sdk/issues/25171#issuecomment-162964721","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/25171","id":162964721,"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":"2015-12-08T18:06:42Z","updated_at":"2015-12-08T18:06:42Z","body":"Hmmm, is that the case? It looks like we have the AST available to us in the InferInstanceMembersInUnitTask task:\r\n```dart\r\nvoid internalPerform() {\r\n    //\r\n    // Prepare inputs.\r\n    //\r\n    CompilationUnit unit = getRequiredInput(UNIT_INPUT);\r\n    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);\r\n    //\r\n    // Infer instance members.\r\n    //\r\n    if (context.analysisOptions.strongMode) {\r\n      InstanceMemberInferrer inferrer = new InstanceMemberInferrer(typeProvider,\r\n          typeSystem: context.typeSystem);\r\n      inferrer.inferCompilationUnit(unit.element);\r\n    }\r\n    //\r\n    // Record outputs.\r\n    //\r\n    outputs[RESOLVED_UNIT9] = unit;\r\n  }\r\n```\r\nWe aren't using it yet (instead we get the .element) but we could, right?"}}