{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6586","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6586/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6586/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6586/events","html_url":"https://github.com/Microsoft/TypeScript/issues/6586","id":128313351,"number":6586,"title":"Incorrect code generation in TSX files","user":{"login":"pdeva","id":3190176,"avatar_url":"https://avatars.githubusercontent.com/u/3190176?v=3","gravatar_id":"","url":"https://api.github.com/users/pdeva","html_url":"https://github.com/pdeva","followers_url":"https://api.github.com/users/pdeva/followers","following_url":"https://api.github.com/users/pdeva/following{/other_user}","gists_url":"https://api.github.com/users/pdeva/gists{/gist_id}","starred_url":"https://api.github.com/users/pdeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdeva/subscriptions","organizations_url":"https://api.github.com/users/pdeva/orgs","repos_url":"https://api.github.com/users/pdeva/repos","events_url":"https://api.github.com/users/pdeva/events{/privacy}","received_events_url":"https://api.github.com/users/pdeva/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-23T08:06:37Z","updated_at":"2016-01-23T09:14:17Z","closed_at":null,"body":"Typescript version 1.7.3.\r\n\r\n\r\n\r\nGiven the following TSX code:\r\n\r\n```\r\nrenderThresholdPanel(metric:MetricDefinition) {\r\n\tvar panel;\r\n\tswitch (metric.unit) {\r\n\t\tcase MetricUnit.PERCENTAGE:\r\n\t\t\tpanel = PercentageThresholdConfigPanel;\r\n\t\t\tbreak;\r\n\t\tcase MetricUnit.RESPONSE_TIME:\r\n\t\t\tpanel = ResponseTimeThresholdConfigPanel;\r\n\t\t\tbreak;\r\n\t\tcase MetricUnit.MEMORY_SIZE:\r\n\t\t\tpanel = MemoryThresholdConfigPanel;\r\n\t\t\tbreak;\r\n\r\n\t}\r\n\r\n\treturn <panel ref=\"thresholdPanel\"/>;\r\n}\r\n```\r\n\r\nThe output is: \r\n\r\n```\r\nfunction (metric) {\r\n\tvar panel;\r\n\tswitch (metric.unit) {\r\n\t    case metricTypes_1.MetricUnit.PERCENTAGE:\r\n\t        panel = percentageThesholdConfigPanel_1.PercentageThresholdConfigPanel;\r\n\t        break;\r\n\t    case metricTypes_1.MetricUnit.RESPONSE_TIME:\r\n\t        panel = responseTimeThresholdConfigPanel_1.ResponseTimeThresholdConfigPanel;\r\n\t        break;\r\n\t    case metricTypes_1.MetricUnit.MEMORY_SIZE:\r\n\t        panel = memoryThresholdConfigPanel_1.MemoryThresholdConfigPanel;\r\n\t        break;\r\n\t}\r\n\r\n\treturn React.createElement(\"panel\", {\"ref\": \"thresholdPanel\"});\r\n};\r\n```\r\n\r\n\r\n**Expected**\r\n\r\nShould have used the `panel` variable\r\n```\r\nreturn React.createElement(panel, {\"ref\": \"thresholdPanel\"});\r\n ```\r\n\r\n**Actual**\r\n\r\nUses the string literal `\"panel\"` instead:\r\n\r\n```\r\nreturn React.createElement(\"panel\", {\"ref\": \"thresholdPanel\"});\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/174165110","html_url":"https://github.com/Microsoft/TypeScript/issues/6586#issuecomment-174165110","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6586","id":174165110,"user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T09:14:17Z","updated_at":"2016-01-23T09:14:17Z","body":"I don't think that's correct. All element names beginning with lowercase letters are intrinsics, and should be emitted to a string. But I'll defer to @RyanCavanaugh instead of closing this."}}