{"action":"opened","issue":{"url":"https://api.github.com/repos/google/kythe/issues/2128","repository_url":"https://api.github.com/repos/google/kythe","labels_url":"https://api.github.com/repos/google/kythe/issues/2128/labels{/name}","comments_url":"https://api.github.com/repos/google/kythe/issues/2128/comments","events_url":"https://api.github.com/repos/google/kythe/issues/2128/events","html_url":"https://github.com/google/kythe/issues/2128","id":335635783,"node_id":"MDU6SXNzdWUzMzU2MzU3ODM=","number":2128,"title":"RFC: Add a new qualified reference edge kind for \"anonymous\" references [phab:T252]","user":{"login":"kythe","id":10677145,"node_id":"MDQ6VXNlcjEwNjc3MTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/10677145?v=4","gravatar_id":"","url":"https://api.github.com/users/kythe","html_url":"https://github.com/kythe","followers_url":"https://api.github.com/users/kythe/followers","following_url":"https://api.github.com/users/kythe/following{/other_user}","gists_url":"https://api.github.com/users/kythe/gists{/gist_id}","starred_url":"https://api.github.com/users/kythe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kythe/subscriptions","organizations_url":"https://api.github.com/users/kythe/orgs","repos_url":"https://api.github.com/users/kythe/repos","events_url":"https://api.github.com/users/kythe/events{/privacy}","received_events_url":"https://api.github.com/users/kythe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-26T02:34:18Z","updated_at":"2018-06-26T02:34:18Z","closed_at":null,"author_association":"COLLABORATOR","body":"_Created by **fromberger** at 2017-06-08 02:34:30_: \n\nThis topic came up in review of #2126.\n\nIn Go, it is possible to initialize a value of struct type using a \"[[ https://golang.org/ref/spec#Composite_literals | composite literal ]]\" notation. C++ aggregate initialization uses a similar construct. For example (using Go), given\n\n```\ntype Person struct {\n  Name, ID string\n  Height int\n}\n```\n\na value of (a pointer to) this type can be constructed literally in various ways:\n\n```\nm := Person{Name: \"michael\", ID: \"creachadair\", Height: 188}  // explicitly-named field initializers (A)\np := Person{\"Michael\", \"creachadair\", 188}                    // unnamed positional initializers (B)\nmp := &Person{Name: \"michael\", Height: 188}                   // as (A) but a pointer, unnamed fields are zero-initialized\n```\n\nTwo questions arise when indexing these forms:\n\n1. Should the unnamed positional initializers be cross-references for the fields they initialize?\n2. If so, how should those cross-references be recorded?\n\nFor (1) I argue that the answer is \"yes\". Prior to #2126 we were not recording them at all (for Go), but based on our (informal) principle that cross-references should identify the places that need to be updated if you change something, these should be included (and one of our users agrees).\n\nFor (2), there are various possibilities, broadly summarized as\n\n- Whether the anchor should be \"on\" the initializer (e.g., the whole expression) or \"at\" the initializer (e.g., just indicating position).\n- Whether the reference should be \"normal\" (`/kythe/edge/ref`) or \"special\" (some new qualified reference kind).\n\njdennett made the case that it makes sense to use a new qualified kind. Excerpting his comments from the review thread:\n\n> A use case: the field is renamed, and a client wants to determine which code to update for that. [The qualified] edges require no update.  Another: fields are reordered.  *Only* [the qualified] initializers need to be updated.\n\nThe suggestions so far have been:\n\n* `/kythe/edge/ref/anon`\n* `/kythe/edge/ref/initializes`\n\nI propose that we adopt a new edge kind, either one of the above or another one (suggestions welcome) as appropriate, for this and related purposes. (jdennett also points out in passing that this might be reusable for languages that initialize parameters either positionally or via \"keyword\" syntax)."}}
{"actor":{"display_login":"kythe"}}