{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/296","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/296/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/296/events","html_url":"https://github.com/Microsoft/TypeScript/issues/296","id":38976456,"number":296,"title":"Alternative syntax for type assertions to allow XML-like syntax extensions","user":{"login":"thorn0","id":94334,"avatar_url":"https://avatars.githubusercontent.com/u/94334?v=3","gravatar_id":"","url":"https://api.github.com/users/thorn0","html_url":"https://github.com/thorn0","followers_url":"https://api.github.com/users/thorn0/followers","following_url":"https://api.github.com/users/thorn0/following{/other_user}","gists_url":"https://api.github.com/users/thorn0/gists{/gist_id}","starred_url":"https://api.github.com/users/thorn0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thorn0/subscriptions","organizations_url":"https://api.github.com/users/thorn0/orgs","repos_url":"https://api.github.com/users/thorn0/repos","events_url":"https://api.github.com/users/thorn0/events{/privacy}","received_events_url":"https://api.github.com/users/thorn0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":108,"created_at":"2014-07-29T10:33:13Z","updated_at":"2015-05-18T10:27:57Z","closed_at":null,"body":"The current syntax for type assertions [prevented](https://github.com/facebook/react/issues/759) the React team from adding TypeScript support to JSX. While [E4X was a failure](http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts.html), XML-like syntax extensions is a good idea, which might make it into some next ECMAScript version. If it happens, it will be impossible to incorporate that syntax into TypeScript because of type assertions.\r\n\r\n(ported from http://typescript.codeplex.com/workitem/2608)"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/103010845","html_url":"https://github.com/Microsoft/TypeScript/issues/296#issuecomment-103010845","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/296","id":103010845,"user":{"login":"duanyao","id":1684137,"avatar_url":"https://avatars.githubusercontent.com/u/1684137?v=3","gravatar_id":"","url":"https://api.github.com/users/duanyao","html_url":"https://github.com/duanyao","followers_url":"https://api.github.com/users/duanyao/followers","following_url":"https://api.github.com/users/duanyao/following{/other_user}","gists_url":"https://api.github.com/users/duanyao/gists{/gist_id}","starred_url":"https://api.github.com/users/duanyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duanyao/subscriptions","organizations_url":"https://api.github.com/users/duanyao/orgs","repos_url":"https://api.github.com/users/duanyao/repos","events_url":"https://api.github.com/users/duanyao/events{/privacy}","received_events_url":"https://api.github.com/users/duanyao/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T10:27:57Z","updated_at":"2015-05-18T10:27:57Z","body":"`cast` is a verb, so should not be placed after the object to be casted. In C++ the syntax is `static_cast<Type>(obj)`. However C++'s syntax is a bit verbose, and may break existing TS codes that has a function named `cast`.\r\n\r\n`is` is a little ambiguous and I'd rather avoid using it. In C# it means \"is left hand an instance of right hand?\"; in python it means \"is left hand identical to right hand ?\"; in both languages `is` expression is boolean.\r\n\r\n`to` and `into` are OK to me. No matter which word or punctuation we choose, we should make sure it won't conflict with new keywords/operators added to ES in future. In this sense I prefer `as`, because it is already used for type casting in multiple languages, so ES will less likely use it.\r\n"}}