{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/2826","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/2826/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/2826/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/2826/events","html_url":"https://github.com/facebook/flow/issues/2826","id":189709312,"number":2826,"title":"Potentially unsafe get/set usage warning","user":{"login":"pronebird","id":704044,"avatar_url":"https://avatars2.githubusercontent.com/u/704044?v=4","gravatar_id":"","url":"https://api.github.com/users/pronebird","html_url":"https://github.com/pronebird","followers_url":"https://api.github.com/users/pronebird/followers","following_url":"https://api.github.com/users/pronebird/following{/other_user}","gists_url":"https://api.github.com/users/pronebird/gists{/gist_id}","starred_url":"https://api.github.com/users/pronebird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pronebird/subscriptions","organizations_url":"https://api.github.com/users/pronebird/orgs","repos_url":"https://api.github.com/users/pronebird/repos","events_url":"https://api.github.com/users/pronebird/events{/privacy}","received_events_url":"https://api.github.com/users/pronebird/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-11-16T13:49:56Z","updated_at":"2017-11-05T18:27:10Z","closed_at":null,"author_association":"NONE","body":"I've got this strange warning: \r\n\r\n>[flow] [flow] Potentially unsafe get/set usage (Getters and setters with side effects are potentially >unsafe and disabled by default. You may opt-in to using them anyway by putting >`unsafe.enable_getters_and_setters=true` into the [options] section of your .flowconfig.)\r\n\r\nCan you clarify what kind of side-effects my plain setter/getter cause?\r\n\r\n```js\r\n// @flow\r\nclass Git {\r\n\r\n  constructor(path: string) {\r\n    this.gitBinary = 'git';\r\n    this._path = path;\r\n  }\r\n\r\n  get path(): string {\r\n    return this._path;\r\n  }\r\n\r\n  set path(path: string) {\r\n    throw new Error('Path is readonly.');\r\n  }\r\n\r\n  get gitBinary(): string {\r\n    return this._gitBinary;\r\n  }\r\n\r\n  set gitBinary(value: string) {\r\n    this._gitBinary = value;\r\n  }\r\n\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/341994036","html_url":"https://github.com/facebook/flow/issues/2826#issuecomment-341994036","issue_url":"https://api.github.com/repos/facebook/flow/issues/2826","id":341994036,"user":{"login":"yoiang","id":89718,"avatar_url":"https://avatars3.githubusercontent.com/u/89718?v=4","gravatar_id":"","url":"https://api.github.com/users/yoiang","html_url":"https://github.com/yoiang","followers_url":"https://api.github.com/users/yoiang/followers","following_url":"https://api.github.com/users/yoiang/following{/other_user}","gists_url":"https://api.github.com/users/yoiang/gists{/gist_id}","starred_url":"https://api.github.com/users/yoiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoiang/subscriptions","organizations_url":"https://api.github.com/users/yoiang/orgs","repos_url":"https://api.github.com/users/yoiang/repos","events_url":"https://api.github.com/users/yoiang/events{/privacy}","received_events_url":"https://api.github.com/users/yoiang/received_events","type":"User","site_admin":false},"created_at":"2017-11-05T18:27:10Z","updated_at":"2017-11-05T18:27:10Z","author_association":"NONE","body":"Unfortunately `// $FlowFixMe` disables all checks vs. enabling only `unsafe.enable_getters_and_setters` for that line as an interim workaround until Flow can understand side effects."}}
{"actor":{"display_login":"yoiang"}}