{"action":"closed","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/10351","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10351/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10351/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10351/events","html_url":"https://github.com/chapel-lang/chapel/issues/10351","id":341641708,"node_id":"MDU6SXNzdWUzNDE2NDE3MDg=","number":10351,"title":"Lifetime checking not working at module scope","user":{"login":"bradcray","id":7536222,"node_id":"MDQ6VXNlcjc1MzYyMjI=","avatar_url":"https://avatars0.githubusercontent.com/u/7536222?v=4","gravatar_id":"","url":"https://api.github.com/users/bradcray","html_url":"https://github.com/bradcray","followers_url":"https://api.github.com/users/bradcray/followers","following_url":"https://api.github.com/users/bradcray/following{/other_user}","gists_url":"https://api.github.com/users/bradcray/gists{/gist_id}","starred_url":"https://api.github.com/users/bradcray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradcray/subscriptions","organizations_url":"https://api.github.com/users/bradcray/orgs","repos_url":"https://api.github.com/users/bradcray/repos","events_url":"https://api.github.com/users/bradcray/events{/privacy}","received_events_url":"https://api.github.com/users/bradcray/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":112762316,"node_id":"MDU6TGFiZWwxMTI3NjIzMTY=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/type:%20Bug","name":"type: Bug","color":"e99695","default":false}],"state":"closed","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":null,"comments":6,"created_at":"2018-07-16T19:10:38Z","updated_at":"2018-11-07T19:02:38Z","closed_at":"2018-11-07T19:02:38Z","author_association":"MEMBER","body":"In the new experimental `--lifetime-checking` feature, I'm seeing different behavior depending on whether code is at module scope vs. function scope.  For example, the following program does generate lifetime errors as expected:\r\n\r\n```chapel\r\nclass A {\r\n  var x: int;\r\n  proc deinit() { writeln(\"deinit \", x); }\r\n  proc writeThis(f) { f.write(x); }\r\n}\r\n\r\nproc main() {\r\n  var cc, dd:\tborrowed A;\r\n\r\n  {\r\n    var c = new borrowed A(3);\r\n    var d = new owned A(4);\r\n\r\n    cc = c;             // error here\r\n    dd = d.borrow();    // and here\r\n\r\n    cc <=> dd;\r\n\r\n    writeln(cc, \" \", dd);\r\n    writeln(c, \" \", d);\r\n  }\r\n\r\n  writeln(dd);\r\n  writeln(cc);\r\n}\r\n```\r\n\r\nBut the following one does not (same program, just with `main()` commented out):\r\n\r\n```chapel\r\nclass A {\r\n  var x: int;\r\n  proc deinit() { writeln(\"deinit \", x); }\r\n  proc writeThis(f) { f.write(x); }\r\n}\r\n\r\n//proc main() {                                                                 \r\n  var cc, dd:\tborrowed A;\r\n\r\n  {\r\n    var c = new borrowed A(3);\r\n    var d = new owned A(4);\r\n\r\n    cc = c;\r\n    dd = d.borrow();\r\n\r\n    cc <=> dd;\r\n\r\n    writeln(cc, \" \", dd);\r\n    writeln(c, \" \", d);\r\n  }\r\n\r\n  writeln(dd);\r\n  writeln(cc);\r\n//}                                                                             \r\n```"}}
{"actor":{"display_login":"mppf"}}