{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23450","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23450/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23450/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23450/events","html_url":"https://github.com/Microsoft/TypeScript/issues/23450","id":314847538,"number":23450,"title":"Methods are converted into properties (in Intellisense at least) when put through a type mapping.","user":{"login":"JabX","id":3266897,"avatar_url":"https://avatars1.githubusercontent.com/u/3266897?v=4","gravatar_id":"","url":"https://api.github.com/users/JabX","html_url":"https://github.com/JabX","followers_url":"https://api.github.com/users/JabX/followers","following_url":"https://api.github.com/users/JabX/following{/other_user}","gists_url":"https://api.github.com/users/JabX/gists{/gist_id}","starred_url":"https://api.github.com/users/JabX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabX/subscriptions","organizations_url":"https://api.github.com/users/JabX/orgs","repos_url":"https://api.github.com/users/JabX/repos","events_url":"https://api.github.com/users/JabX/events{/privacy}","received_events_url":"https://api.github.com/users/JabX/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-16T23:01:30Z","updated_at":"2018-04-17T16:37:08Z","closed_at":null,"author_association":"NONE","body":"**TypeScript Version:**  2.8.1 (but it always has been like this)\r\n\r\n**Search Terms:** Mapped types, Conditional types, methods, properties\r\n\r\n**Code**\r\n<img src=\"https://user-images.githubusercontent.com/3266897/38838836-59f5b722-41d8-11e8-8dec-8267fea3ad4b.png\" height=\"200\" />\r\n\r\n**Expected behavior:**\r\nThe second tooltip displays `(method)`.\r\n**Actual behavior:**\r\nIt displays `(property)`\r\n\r\nBasically, everything that goes through a type mapping of some sort ends up as a property, regardless of that it was before. While this was more or less fine with simple mapped types, because they were used for simple things where you have a lot of control, I feel it's getting a bit out of hand with conditional types.\r\n\r\nLike this:\r\n\r\n<img src=\"https://user-images.githubusercontent.com/3266897/38839090-4cf03b46-41d9-11e8-9b14-6b2a31e898a4.png\" height=\"250\" />\r\n\r\nI've written a simple mapping that transform a few properties into something else, and leaves alone all the others. Here, I've used it with some type that extends Array, and this is what I get.\r\n\r\nI understand that it might not be always right to transform methods into methods, especially since methods can't be readonly or optional (thus my initial example is working as intended, but it was the simplest way I could find to showcase the issue). A \"simple\" fix could be to treat separately the case where a property/method goes unchanged through a mapping (like `{[P in keyof T]: T[P]}`), and in that case to copy the initial property/method over.\r\n\r\n\r\nI'm saying this with no real knowledge of how the compiler works here, so maybe it's not so simple and the feature isn't worth the effort. But if it is, well that would be a nice thing to have :)"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/382059304","html_url":"https://github.com/Microsoft/TypeScript/issues/23450#issuecomment-382059304","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23450","id":382059304,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T16:37:08Z","updated_at":"2018-04-17T16:37:08Z","author_association":"CONTRIBUTOR","body":"that seems like a simpler problem to fix. Today we use the symbol kind to decide whether it is a method or not, we can instead use the declaration. this way we can still go through mapping operations and mark them the same way.."}}
{"actor":{"display_login":"mhegazy"}}