{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26634","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26634/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26634/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26634/events","html_url":"https://github.com/Microsoft/TypeScript/issues/26634","id":353427717,"node_id":"MDU6SXNzdWUzNTM0Mjc3MTc=","number":26634,"title":"Union types doesn't work as expected","user":{"login":"pleerock","id":1753397,"node_id":"MDQ6VXNlcjE3NTMzOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/1753397?v=4","gravatar_id":"","url":"https://api.github.com/users/pleerock","html_url":"https://github.com/pleerock","followers_url":"https://api.github.com/users/pleerock/followers","following_url":"https://api.github.com/users/pleerock/following{/other_user}","gists_url":"https://api.github.com/users/pleerock/gists{/gist_id}","starred_url":"https://api.github.com/users/pleerock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleerock/subscriptions","organizations_url":"https://api.github.com/users/pleerock/orgs","repos_url":"https://api.github.com/users/pleerock/repos","events_url":"https://api.github.com/users/pleerock/events{/privacy}","received_events_url":"https://api.github.com/users/pleerock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-23T15:10:49Z","updated_at":"2018-08-23T15:10:49Z","closed_at":null,"author_association":"NONE","body":"having following types:\r\n\r\n```ts\r\nexport interface Category {\r\n    id: number;\r\n    name: string;\r\n}\r\n\r\nexport interface Post {\r\n    id: number;\r\n    title?: string;\r\n    categories?: Category[];\r\n}\r\n\r\nexport type QueryOptions<T> = {\r\n    [P in keyof T]?:\r\n        T[P] extends Array<infer U> ? QueryOptions<U> :\r\n        T[P] extends ReadonlyArray<infer U> ? QueryOptions<U> :\r\n        boolean\r\n} & {\r\n    $args?: { someOption: number }\r\n}\r\n```\r\n\r\nIf I do following:\r\n\r\n```ts\r\nconst query: QueryOptions<Post> = {\r\n    id: true,\r\n    title: true,\r\n    categories: {\r\n        id2: true\r\n    }\r\n}\r\n```\r\n\r\nit gives me error:\r\n\r\n<img width=\"303\" alt=\"screenshot 2018-08-23 20 09 19\" src=\"https://user-images.githubusercontent.com/1753397/44534046-4e504980-a710-11e8-9b0e-e4d0200e3f49.png\">\r\n\r\n\r\nHowever once I use my $args inside it doesn't give error on \"id2\" anymore\r\n\r\n<img width=\"289\" alt=\"screenshot 2018-08-23 20 10 13\" src=\"https://user-images.githubusercontent.com/1753397/44534096-6cb64500-a710-11e8-81e3-df39d42bf566.png\">\r\n\r\nI expect it to have same error as in the first screenshot. \r\n\r\np.s. sorry for the bad title, hope someone help to make it more concrete. "}}
{"actor":{"display_login":"pleerock"}}