{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/3678","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3678/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3678/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3678/events","html_url":"https://github.com/chapel-lang/chapel/pull/3678","id":145277948,"number":3678,"title":"Add getFieldRef functions to Reflection","user":{"login":"mppf","id":3653132,"avatar_url":"https://avatars.githubusercontent.com/u/3653132?v=3","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":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-04-01T20:26:38Z","updated_at":"2016-04-15T14:24:58Z","closed_at":"2016-04-15T14:21:24Z","pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3678","html_url":"https://github.com/chapel-lang/chapel/pull/3678","diff_url":"https://github.com/chapel-lang/chapel/pull/3678.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/3678.patch"},"body":"Adds getFieldRef functions to Reflection.  These functions support\r\nmutable access to arbitrary fields.\r\n\r\nYou might think that getField should just return a ref if the argument to\r\nit is mutable. Unfortunately Chapel's resolution rules do not support\r\nsuch distinctions at present. Therefore I have created separate functions\r\nfor use when a programmer needs a ref. Also, we might consider making\r\ngetField return const ref.\r\n\r\nI have a related future that still fails for --no-local : \r\n\r\n      test/param/ferguson/getfieldref.chpl\r\n\r\nThat test fails because of the issue described in JIRA 152. Using an\r\nexplicit ref intent on the argument to getFieldRef fixes it for now.\r\n\r\nmake docs works (on linux)\r\nmake check works\r\nPassed full local quickstart tests\r\nPassed full local testing\r\nChecked hellos with verify and valgrind.\r\nPassed param/ferguson with GASNet\r\n\r\nReviewed by @bradcray - thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/210481620","html_url":"https://github.com/chapel-lang/chapel/pull/3678#issuecomment-210481620","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3678","id":210481620,"user":{"login":"bradcray","id":7536222,"avatar_url":"https://avatars.githubusercontent.com/u/7536222?v=3","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},"created_at":"2016-04-15T14:24:58Z","updated_at":"2016-04-15T14:24:58Z","body":"Sure, but they're not testing the getFieldRef() interface.  My point about whitebox testing is that you know that the implementations of these routines are the same, so you feel safe that the code cases are covered and don't feel the need to add getFieldRef()-specific tests.  But if, in the future, they became different (someone had to change the implementation of getFieldRef() for some reason), then the error cases for getFieldRef() may not work and we don't have tests that would point that out.  Right?\r\n"}}