{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2606","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2606/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2606/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2606/events","html_url":"https://github.com/Microsoft/TypeScript/issues/2606","id":66107581,"number":2606,"title":"ES6 should be valid TypeScript","user":{"login":"ChristianKohler","id":4374178,"avatar_url":"https://avatars.githubusercontent.com/u/4374178?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristianKohler","html_url":"https://github.com/ChristianKohler","followers_url":"https://api.github.com/users/ChristianKohler/followers","following_url":"https://api.github.com/users/ChristianKohler/following{/other_user}","gists_url":"https://api.github.com/users/ChristianKohler/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristianKohler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristianKohler/subscriptions","organizations_url":"https://api.github.com/users/ChristianKohler/orgs","repos_url":"https://api.github.com/users/ChristianKohler/repos","events_url":"https://api.github.com/users/ChristianKohler/events{/privacy}","received_events_url":"https://api.github.com/users/ChristianKohler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-03T08:33:15Z","updated_at":"2015-04-04T11:48:16Z","closed_at":"2015-04-04T06:32:12Z","body":"Since TypeScript is a superset of JavaScript it should be possible to compile ES6 code without errors.\r\n\r\nThis valid ES6 snippets throws the following error:\r\n\r\n    Error:(3, 14) TS2339: Property 'weight' does not exist on type 'Car'.\r\n\r\n```javascript\r\nclass Car {\r\n    constructor(weight) {\r\n        this.weight = weight;\r\n    }\r\n}\r\n```\r\n\r\nIs this a bug or a 'feature'?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/89555278","html_url":"https://github.com/Microsoft/TypeScript/issues/2606#issuecomment-89555278","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2606","id":89555278,"user":{"login":"ChristianKohler","id":4374178,"avatar_url":"https://avatars.githubusercontent.com/u/4374178?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristianKohler","html_url":"https://github.com/ChristianKohler","followers_url":"https://api.github.com/users/ChristianKohler/followers","following_url":"https://api.github.com/users/ChristianKohler/following{/other_user}","gists_url":"https://api.github.com/users/ChristianKohler/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristianKohler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristianKohler/subscriptions","organizations_url":"https://api.github.com/users/ChristianKohler/orgs","repos_url":"https://api.github.com/users/ChristianKohler/repos","events_url":"https://api.github.com/users/ChristianKohler/events{/privacy}","received_events_url":"https://api.github.com/users/ChristianKohler/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T11:48:16Z","updated_at":"2015-04-04T11:48:16Z","body":"Thank you all for the comprehensive clarification. That was quick :-)\r\n\r\nI agree with @sccolbert (https://github.com/Microsoft/TypeScript/issues/2393):\r\n\r\n> I was coming at this question from the angle of a new user gradually moving some existing ES6 project to TypeScript. When TypeScript claims (aims) to be a \"superset of ES6\", a new user would expect valid ES6 code to compile without error, just like this ES5 code compiles without error..\r\n\r\nI think that a big part of the success of less/scss is due to the full compatibility with css. Just start with css syntax and gradually learn/use more and more superset features. The same applies to Babel as well. I can just add Babel to my build pipeline without rewriting my exiting code. And I think the same should apply to TypeScript. \r\n\r\nI really like how TypeScript becomes more compatible with ES6 with 1.5. But with issues like this, the ES6 circle (from the ngConf slide) will never be completely inside the TypeScript circle and therefore TypeScript wouldn't be a superset of JavaScript but a own language. (Sorry, sounds a little bit harsh)\r\n\r\n@DanielRosenwasser: I think, it is not just about the cost of declaring a member in this case but the ES6 compatibility as a whole. \r\n\r\n@basarat: I don't understand how https://github.com/Microsoft/TypeScript/issues/766 is related with ES6 compatibility. Isn't this issue rather a duplicate of https://github.com/Microsoft/TypeScript/issues/2393? \r\n\r\nI am interested on what we should do with issues like these. What about tagging issues which are related to ES6 incompatibly? Or creating a ES6 incompatibility list?"}}