{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/2761","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/2761/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/2761/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/2761/events","html_url":"https://github.com/facebook/flow/issues/2761","id":187447304,"number":2761,"title":"Any way to declare getters in interface?","user":{"login":"arv","id":45845,"avatar_url":"https://avatars.githubusercontent.com/u/45845?v=3","gravatar_id":"","url":"https://api.github.com/users/arv","html_url":"https://github.com/arv","followers_url":"https://api.github.com/users/arv/followers","following_url":"https://api.github.com/users/arv/following{/other_user}","gists_url":"https://api.github.com/users/arv/gists{/gist_id}","starred_url":"https://api.github.com/users/arv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arv/subscriptions","organizations_url":"https://api.github.com/users/arv/orgs","repos_url":"https://api.github.com/users/arv/repos","events_url":"https://api.github.com/users/arv/events{/privacy}","received_events_url":"https://api.github.com/users/arv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-04T21:57:30Z","updated_at":"2016-11-05T00:24:15Z","closed_at":null,"body":"Given:\r\n\r\n```js\r\n/* @flow */\r\n\r\ninterface A {\r\n  a: number;  // should really be get a(): number\r\n};\r\n\r\nclass B {\r\n  get a(): number {\r\n    return 42;\r\n  }\r\n}\r\n\r\nconst b: A = new B();\r\n```\r\n\r\nTo make this work in 0.34 I would have to mark `a` as covariant which doesn't seem right."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/258577811","html_url":"https://github.com/facebook/flow/issues/2761#issuecomment-258577811","issue_url":"https://api.github.com/repos/facebook/flow/issues/2761","id":258577811,"user":{"login":"samwgoldman","id":254842,"avatar_url":"https://avatars.githubusercontent.com/u/254842?v=3","gravatar_id":"","url":"https://api.github.com/users/samwgoldman","html_url":"https://github.com/samwgoldman","followers_url":"https://api.github.com/users/samwgoldman/followers","following_url":"https://api.github.com/users/samwgoldman/following{/other_user}","gists_url":"https://api.github.com/users/samwgoldman/gists{/gist_id}","starred_url":"https://api.github.com/users/samwgoldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwgoldman/subscriptions","organizations_url":"https://api.github.com/users/samwgoldman/orgs","repos_url":"https://api.github.com/users/samwgoldman/repos","events_url":"https://api.github.com/users/samwgoldman/events{/privacy}","received_events_url":"https://api.github.com/users/samwgoldman/received_events","type":"User","site_admin":false},"created_at":"2016-11-05T00:24:15Z","updated_at":"2016-11-05T00:24:15Z","body":"It's only mildly useful, but the code we used to have to ensure they were the same was worse than allowing them to be different. You might want to write code like this, which we now support:\r\n\r\n```\r\nclass C {\r\n  _x: string = \"default\";\r\n  get x(): string { return this._x }\r\n  set x(value?: string): void { this._x = value || \"default\" }\r\n}\r\n```"}}
{"actor":{"display_login":"samwgoldman"}}