{"action":"created","issue":{"url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3040","repository_url":"https://api.github.com/repos/idris-lang/Idris-dev","labels_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3040/labels{/name}","comments_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3040/comments","events_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3040/events","html_url":"https://github.com/idris-lang/Idris-dev/issues/3040","id":141237665,"number":3040,"title":"Error message does not name the offending function","user":{"login":"colin-adams","id":123895,"avatar_url":"https://avatars.githubusercontent.com/u/123895?v=3","gravatar_id":"","url":"https://api.github.com/users/colin-adams","html_url":"https://github.com/colin-adams","followers_url":"https://api.github.com/users/colin-adams/followers","following_url":"https://api.github.com/users/colin-adams/following{/other_user}","gists_url":"https://api.github.com/users/colin-adams/gists{/gist_id}","starred_url":"https://api.github.com/users/colin-adams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colin-adams/subscriptions","organizations_url":"https://api.github.com/users/colin-adams/orgs","repos_url":"https://api.github.com/users/colin-adams/repos","events_url":"https://api.github.com/users/colin-adams/events{/privacy}","received_events_url":"https://api.github.com/users/colin-adams/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-16T10:59:16Z","updated_at":"2016-03-16T18:28:12Z","closed_at":null,"body":"When trying to build a package that uses another package (the latter wrapping C functions and still under development, likely to be highly buggy), I get the following:\r\n\r\nidris: Idris function couldn't be wrapped.\r\n\r\nThis is annoying as it does not name the C function that it could not wrap. In this case, I was able to guess the function concerned (commenting out the foreign call stops the message). But really the message should name the function it was attempting to wrap, at least (why it couldn't wrap it would be a bonus)."},"comment":{"url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/comments/197473743","html_url":"https://github.com/idris-lang/Idris-dev/issues/3040#issuecomment-197473743","issue_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3040","id":197473743,"user":{"login":"melted","id":219997,"avatar_url":"https://avatars.githubusercontent.com/u/219997?v=3","gravatar_id":"","url":"https://api.github.com/users/melted","html_url":"https://github.com/melted","followers_url":"https://api.github.com/users/melted/followers","following_url":"https://api.github.com/users/melted/following{/other_user}","gists_url":"https://api.github.com/users/melted/gists{/gist_id}","starred_url":"https://api.github.com/users/melted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melted/subscriptions","organizations_url":"https://api.github.com/users/melted/orgs","repos_url":"https://api.github.com/users/melted/repos","events_url":"https://api.github.com/users/melted/events{/privacy}","received_events_url":"https://api.github.com/users/melted/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T18:28:12Z","updated_at":"2016-03-16T18:28:12Z","body":"The most likely reason to get this this error message is if the idris function is passed as a parameter to the foreign call, that is you have something like this:\r\n\r\n```idris\r\nexample : (Int -> ()) -> IO ()\r\nexample f = foreign FFI_C \"callbacker\" (CFnPtr (Int -> ()) -> IO ()) (MkCFnPtr f)\r\n```\r\n(I see I forgot the MkCFnPtr in the example in the documentation)\r\n\r\nThat isn't supported as it would require too much clairvoyance about what functions are exported to handle in the current implementation, it would have to make an analysis pass to determine all possible candidates.\r\n\r\nThe reason the name isn't in the error message is likely that it isn't immediately available at the location where it's generated. It shouldn't be hard to thread it to there."}}