{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/526","labels_url":"https://api.github.com/repos/facebook/flow/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/526/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/526/events","html_url":"https://github.com/facebook/flow/issues/526","id":88861524,"number":526,"title":"Can't get \"declare module ...\" to work","user":{"login":"AgentME","id":577345,"avatar_url":"https://avatars.githubusercontent.com/u/577345?v=3","gravatar_id":"","url":"https://api.github.com/users/AgentME","html_url":"https://github.com/AgentME","followers_url":"https://api.github.com/users/AgentME/followers","following_url":"https://api.github.com/users/AgentME/following{/other_user}","gists_url":"https://api.github.com/users/AgentME/gists{/gist_id}","starred_url":"https://api.github.com/users/AgentME/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgentME/subscriptions","organizations_url":"https://api.github.com/users/AgentME/orgs","repos_url":"https://api.github.com/users/AgentME/repos","events_url":"https://api.github.com/users/AgentME/events{/privacy}","received_events_url":"https://api.github.com/users/AgentME/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-16T22:57:15Z","updated_at":"2015-06-16T22:57:15Z","closed_at":null,"body":"I'm trying to make some type definitions for some libraries I'm using, but I can't get it to work.\r\n\r\nClone https://github.com/AgentME/flow-test/, run `npm install` (to install lodash locally), and then run \"flow check\". The flow check should fail because of misuse of lodash, but it does not.\r\n\r\nflow-libs/lodash.js (pretty bare-bones so far)\r\n```\r\ndeclare module lodash {\r\n  declare function map<T,U>(array: T[], cb: (value: T, key: number|string, array: T[]) => U, thisArg?: any): U[];\r\n  declare function filter<T>(array: T[], cb: (value: T, key: number|string, array: T[]) => boolean, thisArg?: any): T[];\r\n}\r\n```\r\n\r\nindex.js\r\n```\r\n/* @flow */\r\n// jshint ignore:start\r\n\r\nimport {map} from 'lodash';\r\n\r\n// should work\r\nvar list = map([5, 6], x=>x+1);\r\nconsole.log(list);\r\n\r\n// should fail flow check\r\nvar list2 = map(123, 'foo');\r\nconsole.log(list2);\r\n```"}}