{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13216","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13216/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13216/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13216/events","html_url":"https://github.com/Microsoft/TypeScript/issues/13216","id":198019269,"number":13216,"title":"feature: would like to be able to override Error:(17, 16) TS2408:Setters cannot return a value.","user":{"login":"born2net","id":5090936,"avatar_url":"https://avatars.githubusercontent.com/u/5090936?v=3","gravatar_id":"","url":"https://api.github.com/users/born2net","html_url":"https://github.com/born2net","followers_url":"https://api.github.com/users/born2net/followers","following_url":"https://api.github.com/users/born2net/following{/other_user}","gists_url":"https://api.github.com/users/born2net/gists{/gist_id}","starred_url":"https://api.github.com/users/born2net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/born2net/subscriptions","organizations_url":"https://api.github.com/users/born2net/orgs","repos_url":"https://api.github.com/users/born2net/repos","events_url":"https://api.github.com/users/born2net/events{/privacy}","received_events_url":"https://api.github.com/users/born2net/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-29T14:54:36Z","updated_at":"2016-12-29T16:31:29Z","closed_at":null,"body":"**TypeScript Version:**  2.1.4\r\n\r\n**Code**\r\n\r\n```\r\nimport {StoreModel} from \"../models/StoreModel\";\r\nexport class UserModel extends StoreModel {\r\n\r\n    constructor(data: {user: string, pass: string, reason: string, authenticated: boolean, businessId: number, rememberMe: boolean, authTime?: Date}) {\r\n        super(data);\r\n    }\r\n\r\n    set authenticated(value:boolean) {\r\n        return this.setKey<UserModel>(UserModel, 'authenticated', value);\r\n    }\r\n    \r\n    get authenticated(): boolean {\r\n        return this.getKey('authenticated');\r\n    }\r\n```\r\n\r\nI am using an Immutable model (i.e.: UserModel) and I would like to be able to use setters and getters.\r\nspecifically, for a setter, I get back a new UserModel as I am using immutablejs, so when I set a value in my model, I just get back a new model.\r\n\r\nbut of course I get an error of:\r\n```\r\nError:(17, 16) TS2408:Setters cannot return a value.\r\n```\r\n \r\n**Expected behavior:**\r\nI would love to be able to override this as IMO this is the proper approach, you use a setter on a immutable object and get back a NEW INSTANCE of it...\r\n\r\nthoughts?\r\n\r\nregards\r\n\r\nSean"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/269655422","html_url":"https://github.com/Microsoft/TypeScript/issues/13216#issuecomment-269655422","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13216","id":269655422,"user":{"login":"aluanhaddad","id":5034656,"avatar_url":"https://avatars.githubusercontent.com/u/5034656?v=3","gravatar_id":"","url":"https://api.github.com/users/aluanhaddad","html_url":"https://github.com/aluanhaddad","followers_url":"https://api.github.com/users/aluanhaddad/followers","following_url":"https://api.github.com/users/aluanhaddad/following{/other_user}","gists_url":"https://api.github.com/users/aluanhaddad/gists{/gist_id}","starred_url":"https://api.github.com/users/aluanhaddad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aluanhaddad/subscriptions","organizations_url":"https://api.github.com/users/aluanhaddad/orgs","repos_url":"https://api.github.com/users/aluanhaddad/repos","events_url":"https://api.github.com/users/aluanhaddad/events{/privacy}","received_events_url":"https://api.github.com/users/aluanhaddad/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T16:31:29Z","updated_at":"2016-12-29T16:31:29Z","body":"Let it infer the generic. Also, I am use typescript@next."}}
{"actor":{"display_login":"aluanhaddad"}}