{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/6167","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/6167/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/6167/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/6167/events","html_url":"https://github.com/facebook/hhvm/issues/6167","id":103592850,"number":6167,"title":"Deducing a shape as a generic parameter","user":{"login":"tslettebo","id":7471024,"avatar_url":"https://avatars.githubusercontent.com/u/7471024?v=3","gravatar_id":"","url":"https://api.github.com/users/tslettebo","html_url":"https://github.com/tslettebo","followers_url":"https://api.github.com/users/tslettebo/followers","following_url":"https://api.github.com/users/tslettebo/following{/other_user}","gists_url":"https://api.github.com/users/tslettebo/gists{/gist_id}","starred_url":"https://api.github.com/users/tslettebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tslettebo/subscriptions","organizations_url":"https://api.github.com/users/tslettebo/orgs","repos_url":"https://api.github.com/users/tslettebo/repos","events_url":"https://api.github.com/users/tslettebo/events{/privacy}","received_events_url":"https://api.github.com/users/tslettebo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/hhvm/labels/hack","name":"hack","color":"fe8700"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-27T20:52:02Z","updated_at":"2015-08-27T20:54:49Z","closed_at":null,"body":"Hi.\r\n\r\nIs there a way to have code like this pass the type checker, possibly by making a named shape type, and somehow making g() deduce its T parameter as that type?\r\n```\r\nfunction f(): void\r\n{\r\n  $value=shape('x' => 1,'y' => 1);\r\n\r\n  g($value);\r\n}\r\n\r\nfunction g<T>(T $value): void\r\n{\r\n  echo $value['x']; // Error message here\r\n}\r\n```\r\n\r\nIt gives the error message:\r\n\r\nThis is not an object of type KeyedContainer, this is a value of generic type T (Typing[4005])\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/135552680","html_url":"https://github.com/facebook/hhvm/issues/6167#issuecomment-135552680","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/6167","id":135552680,"user":{"login":"paulbiss","id":1039792,"avatar_url":"https://avatars.githubusercontent.com/u/1039792?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbiss","html_url":"https://github.com/paulbiss","followers_url":"https://api.github.com/users/paulbiss/followers","following_url":"https://api.github.com/users/paulbiss/following{/other_user}","gists_url":"https://api.github.com/users/paulbiss/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbiss/subscriptions","organizations_url":"https://api.github.com/users/paulbiss/orgs","repos_url":"https://api.github.com/users/paulbiss/repos","events_url":"https://api.github.com/users/paulbiss/events{/privacy}","received_events_url":"https://api.github.com/users/paulbiss/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T20:54:49Z","updated_at":"2015-08-27T20:54:49Z","body":"Hmm, this looks like a bug. cc @jwatzman @dlreeves "}}