{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4089","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4089/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4089/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4089/events","html_url":"https://github.com/Microsoft/TypeScript/issues/4089","id":98265660,"number":4089,"title":"Consider only showing builders in object literal completions its contextual type has an index signature","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},"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":1,"created_at":"2015-07-30T21:11:08Z","updated_at":"2015-07-30T21:13:32Z","closed_at":null,"body":"Since users are no longer allowed to have excess properties in an object literal, it might be appropriate to only show a builder when the contextual type of an object literal has no index signature.\r\n\r\nFor instance:\r\n\r\n```TypeScript\r\ntype T = { x: string; y: number; };\r\nfunction f(param: T) {\r\n}\r\n\r\nf({ /*$*/ }); // should only allow 'x' and 'y' and no builder.\r\n```\r\n\r\n*However*, this may not be sufficient; in the presence of a type assertion, one actually *does* want to allow completion, since this is one of the recommended workarounds anyway:\r\n\r\n```TypeScript\r\ntype T = { x: string; y: number; };\r\nfunction f(param: T) {\r\n}\r\n\r\nf(<T>{ /*$*/ }); // should only allow 'x' and 'y' and no builder.\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/126489408","html_url":"https://github.com/Microsoft/TypeScript/issues/4089#issuecomment-126489408","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4089","id":126489408,"user":{"login":"danquirk","id":7121557,"avatar_url":"https://avatars.githubusercontent.com/u/7121557?v=3","gravatar_id":"","url":"https://api.github.com/users/danquirk","html_url":"https://github.com/danquirk","followers_url":"https://api.github.com/users/danquirk/followers","following_url":"https://api.github.com/users/danquirk/following{/other_user}","gists_url":"https://api.github.com/users/danquirk/gists{/gist_id}","starred_url":"https://api.github.com/users/danquirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danquirk/subscriptions","organizations_url":"https://api.github.com/users/danquirk/orgs","repos_url":"https://api.github.com/users/danquirk/repos","events_url":"https://api.github.com/users/danquirk/events{/privacy}","received_events_url":"https://api.github.com/users/danquirk/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T21:13:32Z","updated_at":"2015-07-30T21:13:32Z","body":"Seems like a good idea"}}