{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12662","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12662/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12662/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12662/events","html_url":"https://github.com/Microsoft/TypeScript/issues/12662","id":193437896,"number":12662,"title":"Explicit type parameter breaks Index signature \"inference\"","user":{"login":"AlexGalays","id":1375586,"avatar_url":"https://avatars.githubusercontent.com/u/1375586?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexGalays","html_url":"https://github.com/AlexGalays","followers_url":"https://api.github.com/users/AlexGalays/followers","following_url":"https://api.github.com/users/AlexGalays/following{/other_user}","gists_url":"https://api.github.com/users/AlexGalays/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexGalays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexGalays/subscriptions","organizations_url":"https://api.github.com/users/AlexGalays/orgs","repos_url":"https://api.github.com/users/AlexGalays/repos","events_url":"https://api.github.com/users/AlexGalays/events{/privacy}","received_events_url":"https://api.github.com/users/AlexGalays/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-05T08:32:28Z","updated_at":"2016-12-05T08:32:28Z","closed_at":null,"body":"**TypeScript Version:**  2.0.6 or nightly (2.2.0-dev.20161205)\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface Obj<V> { [key: string]: V }\r\n\r\ninterface Bla {\r\n  iAmABla: string\r\n}\r\n\r\nfunction doSomething(obj: Obj<Bla>) {\r\n  return true\r\n}\r\n\r\nfunction doSomethingElse<T extends Obj<Bla>>(obj: T) {\r\n  return true\r\n}\r\n\r\ninterface ObjBla {\r\n  a: { iAmABla: 'abc' },\r\n  b: { iAmABla: 'def' }\r\n}\r\n\r\nconst input = { a: { iAmABla: '' }, b: { iAmABla: '' } }\r\n\r\ndoSomething(input)\r\ndoSomethingElse<ObjBla>(input)\r\n```\r\n\r\n**Expected behavior:**\r\n\r\ndoSomethingElse should compile, as the passed input's type verifies the constraint.\r\nIn fact, both doSomething and doSomethingElse compile if the type parameter is not explicitely written by the developer (I need it in a more complex scenario where there are two other type parameters and requires me to provide them to lift ambiguities)\r\n\r\n**Actual behavior:**\r\n\r\nerror TS2344: Type 'ObjBla' does not satisfy the constraint 'Obj<Bla>'. Index signature is missing in type 'ObjBla'.\r\n\r\n\r\nOf course there is the workaround of adding an index signature, but it's very annoying in my case as this function is used a lot. I think index signature inference was improved recently, looks like a corner case when a type parameter is explicit.\r\n"}}
{"actor":{"display_login":"AlexGalays"}}