{"action":"opened","issue":{"url":"https://api.github.com/repos/kitlang/kit/issues/28","repository_url":"https://api.github.com/repos/kitlang/kit","labels_url":"https://api.github.com/repos/kitlang/kit/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/kitlang/kit/issues/28/comments","events_url":"https://api.github.com/repos/kitlang/kit/issues/28/events","html_url":"https://github.com/kitlang/kit/issues/28","id":374646259,"node_id":"MDU6SXNzdWUzNzQ2NDYyNTk=","number":28,"title":"\"Couldn't find underlying type for typedef __darwin_pthread_mutex_t\" in kit.sys.dir","user":{"login":"jstasiak","id":36209,"node_id":"MDQ6VXNlcjM2MjA5","avatar_url":"https://avatars0.githubusercontent.com/u/36209?v=4","gravatar_id":"","url":"https://api.github.com/users/jstasiak","html_url":"https://github.com/jstasiak","followers_url":"https://api.github.com/users/jstasiak/followers","following_url":"https://api.github.com/users/jstasiak/following{/other_user}","gists_url":"https://api.github.com/users/jstasiak/gists{/gist_id}","starred_url":"https://api.github.com/users/jstasiak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstasiak/subscriptions","organizations_url":"https://api.github.com/users/jstasiak/orgs","repos_url":"https://api.github.com/users/jstasiak/repos","events_url":"https://api.github.com/users/jstasiak/events{/privacy}","received_events_url":"https://api.github.com/users/jstasiak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-27T13:39:58Z","updated_at":"2018-10-27T13:39:58Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"- **Kit version:** f697e23eb459\r\n- **OS/Platform:** Mac\r\n\r\nTo reproduce:\r\n\r\n```\r\n% kitc -s tests/compile-src/std/sys dir\r\n[2018-10-27 15:36:23.047825] ===> parsing and building module graph\r\n[2018-10-27 15:36:23.065508] ===> processing C includes\r\n[2018-10-27 15:36:23.383669] ===> resolving module types\r\n[2018-10-27 15:36:23.405392] ===> typing module content\r\n[2018-10-27 15:36:23.422767] ===> generating intermediate representation\r\n----------------------------------------\r\nError: /Users/kuba/projects/kit/std/kit/sys/dir.kit:22: Couldn't find underlying type for typedef __darwin_pthread_mutex_t\r\n\r\n  @/Users/kuba/projects/kit/std/kit/sys/dir.kit:22:13-30\r\n      22                var __dir = $this;\r\n                        ^^^^^^^^^^^^^^^^^^\r\n\r\n----------------------------------------\r\nError: /Users/kuba/projects/kit/std/kit/sys/dir.kit:24: Couldn't find underlying type for typedef __darwin_pthread_mutex_t\r\n\r\n  @/Users/kuba/projects/kit/std/kit/sys/dir.kit:24:46-52\r\n      24                    var __next: Ptr[Directory] = readdir(__dir) as Ptr[Directory];\r\n                                                         ^^^^^^^\r\n\r\n[2018-10-27 15:36:23.427004] ===> total time: 0.376684s\r\n[2018-10-27 15:36:23.427423] ERR: compilation failed (2 errors)\r\n```\r\n\r\nThe relevant parts of `dirent.h` expansion:\r\n\r\n```\r\n% gcc -E /usr/include/dirent.h\r\n(...)\r\n\r\nstruct _opaque_pthread_mutex_t {\r\n long __sig;\r\n char __opaque[56];\r\n};\r\n\r\n(...)\r\n\r\ntypedef struct _opaque_pthread_mutex_t __darwin_pthread_mutex_t;\r\n\r\n(...)\r\n\r\ntypedef struct {\r\n int __dd_fd;\r\n long __dd_loc;\r\n long __dd_size;\r\n char *__dd_buf;\r\n int __dd_len;\r\n long __dd_seek;\r\n __attribute__((unused)) long __padding;\r\n int __dd_flags;\r\n __darwin_pthread_mutex_t __dd_lock;\r\n struct _telldir *__dd_td;\r\n} DIR;\r\n\r\n(...)\r\n```\r\n"}}
{"actor":{"display_login":"jstasiak"}}