{"action":"closed","issue":{"url":"https://api.github.com/repos/Danappelxx/SwiftMongoDB/issues/18","repository_url":"https://api.github.com/repos/Danappelxx/SwiftMongoDB","labels_url":"https://api.github.com/repos/Danappelxx/SwiftMongoDB/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/Danappelxx/SwiftMongoDB/issues/18/comments","events_url":"https://api.github.com/repos/Danappelxx/SwiftMongoDB/issues/18/events","html_url":"https://github.com/Danappelxx/SwiftMongoDB/issues/18","id":138669199,"number":18,"title":"BSON.Number rawValue initializer always returns `nil`","user":{"login":"svanimpe","id":1496250,"avatar_url":"https://avatars.githubusercontent.com/u/1496250?v=3","gravatar_id":"","url":"https://api.github.com/users/svanimpe","html_url":"https://github.com/svanimpe","followers_url":"https://api.github.com/users/svanimpe/followers","following_url":"https://api.github.com/users/svanimpe/following{/other_user}","gists_url":"https://api.github.com/users/svanimpe/gists{/gist_id}","starred_url":"https://api.github.com/users/svanimpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanimpe/subscriptions","organizations_url":"https://api.github.com/users/svanimpe/orgs","repos_url":"https://api.github.com/users/svanimpe/repos","events_url":"https://api.github.com/users/svanimpe/events{/privacy}","received_events_url":"https://api.github.com/users/svanimpe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-05T10:52:41Z","updated_at":"2016-03-08T07:06:59Z","closed_at":"2016-03-08T07:06:59Z","body":"The following prints `nil`:\r\n\r\n```\r\nlet bsonNumber = BSON.Number(rawValue: 11)\r\nprint(bsonNumber)\r\n```\r\n\r\nThis is likely the reason (from `BSON.swift`):\r\n\r\n```\r\n    public init?(rawValue: Any) {\r\n        \r\n        if let value = rawValue as? Bool            { self = .Boolean(value) }\r\n        if let value = rawValue as? Int32           { self = .Integer32(value) }\r\n        if let value = rawValue as? Int64           { self = .Integer64(value) }\r\n        if let value = rawValue as? Swift.Double     { self = .Double(value)  }\r\n        \r\n        return nil\r\n    }\r\n```\r\n\r\nI am running the March 1 build of Swift on Ubuntu 15.10"}}