{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/6589","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/6589/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/6589/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/6589/events","html_url":"https://github.com/facebook/flow/issues/6589","id":340042486,"node_id":"MDU6SXNzdWUzNDAwNDI0ODY=","number":6589,"title":"node: Cannot use `Socket` because it doesn't match `net$Socket`","user":{"login":"tbremer","id":2998575,"node_id":"MDQ6VXNlcjI5OTg1NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/2998575?v=4","gravatar_id":"","url":"https://api.github.com/users/tbremer","html_url":"https://github.com/tbremer","followers_url":"https://api.github.com/users/tbremer/followers","following_url":"https://api.github.com/users/tbremer/following{/other_user}","gists_url":"https://api.github.com/users/tbremer/gists{/gist_id}","starred_url":"https://api.github.com/users/tbremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbremer/subscriptions","organizations_url":"https://api.github.com/users/tbremer/orgs","repos_url":"https://api.github.com/users/tbremer/repos","events_url":"https://api.github.com/users/tbremer/events{/privacy}","received_events_url":"https://api.github.com/users/tbremer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T23:37:33Z","updated_at":"2018-07-10T23:37:33Z","closed_at":null,"author_association":"NONE","body":"I have an code snippet that looks (basically) like this:\r\n\r\n```javsacript\r\nexport default function handleSocket(request: IncomingMessage, response: ServerResponse): void {\r\n  /* … */\r\n  return listenToSocket(request.socket);\r\n}\r\n\r\nfunction listenToSocket(socket: Socket): void { /* … */ }\r\n```\r\n\r\n`flow` is returning an error on `return listenToSocket(request.socket);` saying: \r\n\r\n> request.socket (Cannot call `listenToSocket` with `request.socket` bound to `socket` because `net$Socket` [1] is incompatible with `Socket` [2].)\r\n\r\nHowever in the type definitions `Socket` is only an extension of `net$Socket` (https://github.com/facebook/flow/blob/ac184467b87d2726c193aea332be9695ce3d5185/lib/node.js#L1402).\r\n\r\nI feel like this message is an error, but I am not sure how to circumvent it.\r\n\r\nAny help would be great!"}}
{"actor":{"display_login":"tbremer"}}