{"action":"opened","issue":{"url":"https://api.github.com/repos/msoucy/dproto/issues/89","repository_url":"https://api.github.com/repos/msoucy/dproto","labels_url":"https://api.github.com/repos/msoucy/dproto/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/msoucy/dproto/issues/89/comments","events_url":"https://api.github.com/repos/msoucy/dproto/issues/89/events","html_url":"https://github.com/msoucy/dproto/issues/89","id":166445071,"number":89,"title":"[de]serialization issue -- [packed = true] sint32, sint64, and double","user":{"login":"bloche","id":2810059,"avatar_url":"https://avatars.githubusercontent.com/u/2810059?v=3","gravatar_id":"","url":"https://api.github.com/users/bloche","html_url":"https://github.com/bloche","followers_url":"https://api.github.com/users/bloche/followers","following_url":"https://api.github.com/users/bloche/following{/other_user}","gists_url":"https://api.github.com/users/bloche/gists{/gist_id}","starred_url":"https://api.github.com/users/bloche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloche/subscriptions","organizations_url":"https://api.github.com/users/bloche/orgs","repos_url":"https://api.github.com/users/bloche/repos","events_url":"https://api.github.com/users/bloche/events{/privacy}","received_events_url":"https://api.github.com/users/bloche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-19T21:55:30Z","updated_at":"2016-07-19T21:55:30Z","closed_at":null,"body":"```d\r\nmodule dosmpbf.test;\r\n\r\nimport dproto.dproto;\r\n\r\nmixin ProtocolBufferFromString!q{\r\n    message Test {\r\n        repeated sint32 id = 1 [packed = true];\r\n    }\r\n\r\n};\r\n\r\nunittest {\r\n    Test t;\r\n\r\n    t.id = [123];\r\n\r\n    std.stdio.writeln(t);\r\n\r\n    auto s = t.serialize();\r\n    t = Test(s);\r\n\r\n    std.stdio.writeln(t);\r\n\r\n    assert(t.id == [123]);\r\n}\r\n```\r\n\r\nDeserializing a packed array of signed numbers appears to append a zero.\r\n\r\n```\r\nTest([123])\r\nTest([123, 0])\r\ncore.exception.AssertError@src/dosmpbf/test.d(24): unittest failure\r\n```\r\n\r\nIf `id` were a double I get:\r\n\r\n```\r\nTest([123])\r\ncore.exception.RangeError@std/bitmanip.d(2987): Range violation\r\n```\r\n\r\nThe other number types run though fine. e.g. `int32`, `uint64`, etc."}}
{"actor":{"display_login":"bloche"}}