{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/10397","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10397/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10397/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10397/events","html_url":"https://github.com/chapel-lang/chapel/issues/10397","id":342488925,"node_id":"MDU6SXNzdWUzNDI0ODg5MjU=","number":10397,"title":"fields not usable after Module.getRecord()","user":{"login":"mppf","id":3653132,"node_id":"MDQ6VXNlcjM2NTMxMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3653132?v=4","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"labels":[{"id":496591117,"node_id":"MDU6TGFiZWw0OTY1OTExMTc=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/area:%20Compiler","name":"area: Compiler","color":"d4c5f9","default":false},{"id":499565193,"node_id":"MDU6TGFiZWw0OTk1NjUxOTM=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/area:%20Language","name":"area: Language","color":"d4c5f9","default":false},{"id":520459015,"node_id":"MDU6TGFiZWw1MjA0NTkwMTU=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/user%20issue","name":"user issue","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"lydia-duncan","id":2454710,"node_id":"MDQ6VXNlcjI0NTQ3MTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2454710?v=4","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false},"assignees":[{"login":"lydia-duncan","id":2454710,"node_id":"MDQ6VXNlcjI0NTQ3MTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2454710?v=4","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-07-18T20:56:23Z","updated_at":"2018-07-20T14:44:53Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The following programs do not compile but one might expect them to.\r\n\r\nIn both cases, an explicit module decorates a function call to a module that is not used (e.g. `C.make_struct()` ). This function returns a record. Following code cannot access the record's field.\r\n\r\n\r\n test/classes/ferguson/module-call-returns-type.chpl\r\n\r\n``` chapel\r\nmodule C {\r\n  record my_struct {\r\n    var my_field:c_int;\r\n  }\r\n\r\n  proc make_struct():my_struct {\r\n    var ret:my_struct;\r\n    ret.my_field = 0;\r\n    return ret;\r\n  }\r\n}\r\n\r\nproc test() {\r\n  var tmp = C.make_struct();\r\n  var f = tmp.my_field;\r\n  writeln(f);\r\n}\r\n\r\ntest();\r\n```\r\n\r\n test/extern/ferguson/externblock/extern-record-field-scope-issue.chpl\r\n\r\n``` chapel\r\nmodule C {\r\n  extern {\r\n    typedef struct my_struct {\r\n      int my_field;\r\n    } my_struct;\r\n\r\n    static my_struct make_struct(void) {\r\n      my_struct ret;\r\n      ret.my_field = 0;\r\n      return ret;\r\n    }\r\n  }\r\n}\r\n\r\nproc test() {\r\n  var tmp = C.make_struct();\r\n  var f = tmp.my_field;\r\n  writeln(f);\r\n}\r\n\r\ntest();\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/406622489","html_url":"https://github.com/chapel-lang/chapel/issues/10397#issuecomment-406622489","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10397","id":406622489,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjYyMjQ4OQ==","user":{"login":"mppf","id":3653132,"node_id":"MDQ6VXNlcjM2NTMxMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3653132?v=4","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T14:44:53Z","updated_at":"2018-07-20T14:44:53Z","author_association":"CONTRIBUTOR","body":"There's probably a better way, though..."}}
{"actor":{"display_login":"mppf"}}