{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4823","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4823/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4823/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4823/events","html_url":"https://github.com/facebook/hhvm/issues/4823","id":57353197,"number":4823,"title":"autoload_set_paths incorrectly typed","user":{"login":"oyamauchi","id":107014,"avatar_url":"https://avatars.githubusercontent.com/u/107014?v=3","gravatar_id":"","url":"https://api.github.com/users/oyamauchi","html_url":"https://github.com/oyamauchi","followers_url":"https://api.github.com/users/oyamauchi/followers","following_url":"https://api.github.com/users/oyamauchi/following{/other_user}","gists_url":"https://api.github.com/users/oyamauchi/gists{/gist_id}","starred_url":"https://api.github.com/users/oyamauchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyamauchi/subscriptions","organizations_url":"https://api.github.com/users/oyamauchi/orgs","repos_url":"https://api.github.com/users/oyamauchi/repos","events_url":"https://api.github.com/users/oyamauchi/events{/privacy}","received_events_url":"https://api.github.com/users/oyamauchi/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":3,"created_at":"2015-02-11T18:04:51Z","updated_at":"2015-02-13T21:27:02Z","closed_at":null,"body":"This is the signature for `autoload_set_paths`, in functions.hhi:\r\n\r\n```hack\r\n  function autoload_set_paths(\r\n    \\Indexish<string, \\Indexish<string, string>> $map,\r\n    string $root,\r\n  ): bool;\r\n```\r\n\r\nThis causes an error if the map includes the 'failure' key, because it maps to a function, which isn't Indexish.\r\n\r\nUnfortunately, I think the best we can do is to change the type of $map to `Indexish<string, mixed>`. Another option is to split the failure callback into a separate parameter (which seems cleaner overall), but that would break BC."},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/74329815","html_url":"https://github.com/facebook/hhvm/issues/4823#issuecomment-74329815","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4823","id":74329815,"user":{"login":"oyamauchi","id":107014,"avatar_url":"https://avatars.githubusercontent.com/u/107014?v=3","gravatar_id":"","url":"https://api.github.com/users/oyamauchi","html_url":"https://github.com/oyamauchi","followers_url":"https://api.github.com/users/oyamauchi/followers","following_url":"https://api.github.com/users/oyamauchi/following{/other_user}","gists_url":"https://api.github.com/users/oyamauchi/gists{/gist_id}","starred_url":"https://api.github.com/users/oyamauchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyamauchi/subscriptions","organizations_url":"https://api.github.com/users/oyamauchi/orgs","repos_url":"https://api.github.com/users/oyamauchi/repos","events_url":"https://api.github.com/users/oyamauchi/events{/privacy}","received_events_url":"https://api.github.com/users/oyamauchi/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T21:27:02Z","updated_at":"2015-02-13T21:27:02Z","body":"Oh yeah, you're right. So the shape is:\r\n\r\n```hack\r\ntype autoload_map = shape(\r\n  'function' => \\Indexish<string, string>,\r\n  'class'    => \\Indexish<string, string>,\r\n  'constant' => \\Indexish<string, string>,\r\n  'type'     => \\Indexish<string, string>,\r\n  'failure'  => (function(string, string): ?bool)\r\n);\r\n```"}}