{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26957","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26957/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26957/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26957/events","html_url":"https://github.com/Microsoft/TypeScript/issues/26957","id":358052536,"node_id":"MDU6SXNzdWUzNTgwNTI1MzY=","number":26957,"title":"Violation of encapsulation","user":{"login":"escapade1990","id":43067739,"node_id":"MDQ6VXNlcjQzMDY3NzM5","avatar_url":"https://avatars0.githubusercontent.com/u/43067739?v=4","gravatar_id":"","url":"https://api.github.com/users/escapade1990","html_url":"https://github.com/escapade1990","followers_url":"https://api.github.com/users/escapade1990/followers","following_url":"https://api.github.com/users/escapade1990/following{/other_user}","gists_url":"https://api.github.com/users/escapade1990/gists{/gist_id}","starred_url":"https://api.github.com/users/escapade1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escapade1990/subscriptions","organizations_url":"https://api.github.com/users/escapade1990/orgs","repos_url":"https://api.github.com/users/escapade1990/repos","events_url":"https://api.github.com/users/escapade1990/events{/privacy}","received_events_url":"https://api.github.com/users/escapade1990/received_events","type":"User","site_admin":false},"labels":[{"id":113971226,"node_id":"MDU6TGFiZWwxMTM5NzEyMjY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-07T12:44:49Z","updated_at":"2018-11-17T00:31:09Z","closed_at":"2018-11-17T00:31:09Z","author_association":"NONE","body":"Hi all,\r\nI've tested the following code:\r\n```ts\r\nclass TestPrivate {\r\n    public publicField: number;\r\n    private privateField: number;\r\n    constructor(pr: number, pub: number) {\r\n        this.privateField = pr;\r\n        this.publicField = pub;\r\n    }\r\n\r\n}\r\n\r\nconst obj1 = new TestPrivate(123, 789);\r\n\r\nconst temp = { fakeWrapper: obj1 };\r\n\r\nconst { fakeWrapper: { privateField } } = temp;\r\n\r\nconsole.log(privateField);\r\n```\r\nAnd I see in console 123 output. It seems that we have a violation of encapsulation here."}}
{"actor":{"display_login":"andy-ms"}}