-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: go/types: add Select function #70737
Comments
Related Issues
Related Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
What is the problem with defining this (rather small) function external to go/types? |
The expression |
Some questions:
func MakeSelection(kind SelectionKind, recvType, obj Object, index []int, indirect bool) Selection which would provide max. flexibility; or, if not |
|
Background: The type checker has two different APIs for the same concept, namely information about a selection of a field or method:
Info.Selections
andMethodSet
both use the record typeSelection
;LookupFieldOrMethod
returns a triple, (obj, indices, indirect).There is no way to construct a
Selection
from the result ofLookupFieldOrMethod
. Especially when operating in parallel on the method sets of two types, it is a perennial nuisance that these corresponding items have different forms.Proposal: We propose a function,
Select
, to bridge this gap.Related:
@findleyr @griesemer @timothy-king
The text was updated successfully, but these errors were encountered: