{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/22610","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/22610/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/22610/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/22610/events","html_url":"https://github.com/Microsoft/TypeScript/issues/22610","id":305695773,"node_id":"MDU6SXNzdWUzMDU2OTU3NzM=","number":22610,"title":"Inferred type symbol in conditional type should be visible-but-banned in falsy arm","user":{"login":"RyanCavanaugh","id":6685088,"node_id":"MDQ6VXNlcjY2ODUwODg=","avatar_url":"https://avatars3.githubusercontent.com/u/6685088?v=4","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"labels":[{"id":117630901,"node_id":"MDU6TGFiZWwxMTc2MzA5MDE=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Declined","name":"Declined","color":"556677","default":false},{"id":113971155,"node_id":"MDU6TGFiZWwxMTM5NzExNTU=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-15T19:49:07Z","updated_at":"2018-08-13T20:41:05Z","closed_at":"2018-08-13T20:41:05Z","author_association":"MEMBER","body":"Currently if you write\r\n```ts\r\ntype C<T> = T extends infer U ? U : U;\r\n//                                  ~ Cannot find name \"U\"\r\n```\r\nWe give you an error because `U` is not in scope at all in the false arm.\r\n\r\nThis is a) confusing (`U` is right there!) and b) a landmine, because you might have an outer type of the same name\r\n```ts\r\n// Elsewhere\r\ntype U = string;\r\n// ...\r\n/// Not what I meant!\r\ntype C<T> = T extends infer U ? number : U;\r\n```\r\n\r\nWe should keep `U` in scope in both cases and disallow its use with an explicit error message, e.g. (please bikeshed):\r\n\r\n > Inferred type parameter \"U\" is unmatched in this case and cannot be used\r\n\r\nThis should *not* block nesting of lexical scopes; i.e. this should still be legal because each `U` would shadow the outer expression's:\r\n```ts\r\ntype C<T> = T extends Array<infer U> ? U :\r\n            T extends Promise<infer U> ? U :\r\n            never;\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/412656576","html_url":"https://github.com/Microsoft/TypeScript/issues/22610#issuecomment-412656576","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/22610","id":412656576,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjY1NjU3Ng==","user":{"login":"RyanCavanaugh","id":6685088,"node_id":"MDQ6VXNlcjY2ODUwODg=","avatar_url":"https://avatars3.githubusercontent.com/u/6685088?v=4","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"created_at":"2018-08-13T20:41:05Z","updated_at":"2018-08-13T20:41:05Z","author_association":"MEMBER","body":"This one missed the boat"}}
{"actor":{"display_login":"RyanCavanaugh"}}