{"action":"opened","issue":{"url":"https://api.github.com/repos/rakudo/rakudo/issues/1982","repository_url":"https://api.github.com/repos/rakudo/rakudo","labels_url":"https://api.github.com/repos/rakudo/rakudo/issues/1982/labels{/name}","comments_url":"https://api.github.com/repos/rakudo/rakudo/issues/1982/comments","events_url":"https://api.github.com/repos/rakudo/rakudo/issues/1982/events","html_url":"https://github.com/rakudo/rakudo/issues/1982","id":336491801,"node_id":"MDU6SXNzdWUzMzY0OTE4MDE=","number":1982,"title":"\"Unknown type NativeCall::Types::void used in native call.\"","user":{"login":"JJ","id":500,"node_id":"MDQ6VXNlcjUwMA==","avatar_url":"https://avatars3.githubusercontent.com/u/500?v=4","gravatar_id":"","url":"https://api.github.com/users/JJ","html_url":"https://github.com/JJ","followers_url":"https://api.github.com/users/JJ/followers","following_url":"https://api.github.com/users/JJ/following{/other_user}","gists_url":"https://api.github.com/users/JJ/gists{/gist_id}","starred_url":"https://api.github.com/users/JJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JJ/subscriptions","organizations_url":"https://api.github.com/users/JJ/orgs","repos_url":"https://api.github.com/users/JJ/repos","events_url":"https://api.github.com/users/JJ/events{/privacy}","received_events_url":"https://api.github.com/users/JJ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T06:37:31Z","updated_at":"2018-06-28T06:37:31Z","closed_at":null,"author_association":"NONE","body":"## The Problem\r\n\r\nHere's this little C program\r\n\r\n```c\r\n#include <stdio.h>\r\n\r\nvoid this_is_void () {\r\n    printf(\"This is void\\n\");\r\n}\r\n```\r\n\r\n\r\nWhich I call from this Perl 6 script\r\n\r\n```perl6\r\nuse v6;\r\nuse NativeCall;\r\n\r\nsub this_is_void( --> void ) is native(\"./libvoid.so\") { * };\r\n\r\nthis_is_void();\r\n```\r\n\r\n\r\n## Expected Behavior\r\n\r\nSince `void` is a valid Native type, this should be no problem. Or else, just say \"native \"void\" maps to no return type in Perl 6\". Something like that.\r\n\r\n## Actual Behavior\r\n\r\nError above:\r\n\r\n```\r\nUnknown type NativeCall::Types::void used in native call.\r\nIf you want to pass a struct, be sure to use the CStruct or\r\nCPPStruct representation.\r\n```\r\n\r\nI can declare no return type (which is what void is actually about):\r\n\r\n```perl6\r\nsub this_is_void() is native(\"./libvoid.so\") { * };\r\n\r\nmy $ret = this_is_void();\r\nsay $ret;\r\n```\r\n\r\nBut this prints `(Mu)` instead of yielding some kind of error because we're getting the return of something that returns nothing. \r\n\r\n## Steps to Reproduce\r\n\r\nCompile the c to a dynamic library, run the perl6 script. \r\n\r\n## Environment\r\n* Operating system: Ubuntu 14.04 server\r\n* Compiler version (`perl6 -v`): \r\n\r\n```\r\nThis is Rakudo version 2018.06 built on MoarVM version 2018.06\r\nimplementing Perl 6.c.\r\n\r\n```\r\n"}}
{"actor":{"display_login":"JJ"}}