{"action":"opened","issue":{"url":"https://api.github.com/repos/Araq/Nim/issues/2536","labels_url":"https://api.github.com/repos/Araq/Nim/issues/2536/labels{/name}","comments_url":"https://api.github.com/repos/Araq/Nim/issues/2536/comments","events_url":"https://api.github.com/repos/Araq/Nim/issues/2536/events","html_url":"https://github.com/Araq/Nim/issues/2536","id":67938458,"number":2536,"title":"C++ wrapped sequence contents get zeroed out when sequence returned from function","user":{"login":"dhasenan","id":578393,"avatar_url":"https://avatars.githubusercontent.com/u/578393?v=3","gravatar_id":"","url":"https://api.github.com/users/dhasenan","html_url":"https://github.com/dhasenan","followers_url":"https://api.github.com/users/dhasenan/followers","following_url":"https://api.github.com/users/dhasenan/following{/other_user}","gists_url":"https://api.github.com/users/dhasenan/gists{/gist_id}","starred_url":"https://api.github.com/users/dhasenan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhasenan/subscriptions","organizations_url":"https://api.github.com/users/dhasenan/orgs","repos_url":"https://api.github.com/users/dhasenan/repos","events_url":"https://api.github.com/users/dhasenan/events{/privacy}","received_events_url":"https://api.github.com/users/dhasenan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-12T17:44:13Z","updated_at":"2015-04-12T17:44:13Z","closed_at":null,"body":"Devel, first noticed on revision 28ecf72f79efa55f48b4ecd7cbe4ca29ccaa0f95.\r\n\r\nvec.nim:\r\n```\r\ntype Vector3 {.importcpp: \"Vector3\", header: \"vec.h\"} = object\r\n  x: cfloat\r\n\r\nproc constructVector3(a: cfloat): Vector3 {.importcpp: \"Vector3(@)\", header: \"vec.h\"}\r\n\r\nproc vec3List*(): seq[Vector3] =\r\n  let s = @[constructVector3(cfloat(1)), constructVector3(cfloat(1))]\r\n  echo($s)\r\n  return s\r\n\r\nlet f = vec3List()\r\necho($f)\r\n```\r\n\r\nvec.h:\r\n```\r\nstruct Vector3 {\r\npublic:\r\n  Vector3(): x(5) {}\r\n  Vector3(float x_): x(x_) {}\r\n  float x;\r\n};\r\n```\r\n\r\nExpected output:\r\n```\r\n@[(x: 1.0), (x: 1.0)]\r\n@[(x: 1.0), (x: 1.0)]\r\n```\r\n\r\nActual output:\r\n```\r\n@[(x: 1.0), (x: 1.0)]\r\n@[(x: 0.0), (x: 0.0)]\r\n```"}}