{"action":"created","issue":{"url":"https://api.github.com/repos/Araq/Nim/issues/2596","labels_url":"https://api.github.com/repos/Araq/Nim/issues/2596/labels{/name}","comments_url":"https://api.github.com/repos/Araq/Nim/issues/2596/comments","events_url":"https://api.github.com/repos/Araq/Nim/issues/2596/events","html_url":"https://github.com/Araq/Nim/pull/2596","id":70720183,"number":2596,"title":"Fix floats in tuples in HashSets","user":{"login":"Nycto","id":30517,"avatar_url":"https://avatars.githubusercontent.com/u/30517?v=3","gravatar_id":"","url":"https://api.github.com/users/Nycto","html_url":"https://github.com/Nycto","followers_url":"https://api.github.com/users/Nycto/followers","following_url":"https://api.github.com/users/Nycto/following{/other_user}","gists_url":"https://api.github.com/users/Nycto/gists{/gist_id}","starred_url":"https://api.github.com/users/Nycto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nycto/subscriptions","organizations_url":"https://api.github.com/users/Nycto/orgs","repos_url":"https://api.github.com/users/Nycto/repos","events_url":"https://api.github.com/users/Nycto/events{/privacy}","received_events_url":"https://api.github.com/users/Nycto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-24T15:30:57Z","updated_at":"2015-04-24T15:43:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Araq/Nim/pulls/2596","html_url":"https://github.com/Araq/Nim/pull/2596","diff_url":"https://github.com/Araq/Nim/pull/2596.diff","patch_url":"https://github.com/Araq/Nim/pull/2596.patch"},"body":"Previously, the added tests would fail to compile with errors complaining that 'hash(float)' didn't exist. The problem was that `hash(float)` was declared below `hash(tuple)` and thus wasn't visible. Rearranging things and adding a few forward declarations fixed it.\r\n\r\nSpecifically, this was the error:\r\n\r\n```\r\ntests/collections/tsets.nim(19, 5) Info: template/generic instantiation from here\r\nlib/pure/collections/sets.nim(200, 20) Info: template/generic instantiation from here\r\nlib/pure/collections/sets.nim(142, 11) Info: template/generic instantiation from here\r\nlib/pure/hashes.nim(149, 27) Error: type mismatch: got (float)\r\nbut expected one of: \r\nhashes.hash(x: string)\r\nhashes.hash(x: char)\r\nhashes.hash(x: T)\r\nhashes.hash(x: int)\r\nhashes.hash(x: pointer)\r\nhashes.hash(x: int64)\r\nhashes.hash(x: T)\r\nhash.hash(x: tuple[i: int, i64: int64, f: float])\r\n```\r\n\r\nInterestingly, I couldn't repro this problem when importing the `hashes` module directly, on when trying to create sets. I'm not sure why.\r\n\r\nAlso, this change contains a bunch of white space cleanup, too. Github lets you see the diff without whitespace included by adding [?w=1](https://github.com/Araq/Nim/pull/2596/files?w=1) to the URL, but I'm also happy to revert it if you would like. "},"comment":{"url":"https://api.github.com/repos/Araq/Nim/issues/comments/95971116","html_url":"https://github.com/Araq/Nim/pull/2596#issuecomment-95971116","issue_url":"https://api.github.com/repos/Araq/Nim/issues/2596","id":95971116,"user":{"login":"Araq","id":287816,"avatar_url":"https://avatars.githubusercontent.com/u/287816?v=3","gravatar_id":"","url":"https://api.github.com/users/Araq","html_url":"https://github.com/Araq","followers_url":"https://api.github.com/users/Araq/followers","following_url":"https://api.github.com/users/Araq/following{/other_user}","gists_url":"https://api.github.com/users/Araq/gists{/gist_id}","starred_url":"https://api.github.com/users/Araq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Araq/subscriptions","organizations_url":"https://api.github.com/users/Araq/orgs","repos_url":"https://api.github.com/users/Araq/repos","events_url":"https://api.github.com/users/Araq/events{/privacy}","received_events_url":"https://api.github.com/users/Araq/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T15:43:34Z","updated_at":"2015-04-24T15:43:34Z","body":"This shouldn't be necessary at all since 'hash' is an open sym choice in a generic. Not sure what's going on here."}}