Skip to content
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

cmd/compile: move most (*Type).IsFoo methods to (EType).IsFoo #16929

Open
mdempsky opened this issue Aug 30, 2016 · 0 comments
Open

cmd/compile: move most (*Type).IsFoo methods to (EType).IsFoo #16929

mdempsky opened this issue Aug 30, 2016 · 0 comments
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

In type.go, we have a bunch of helper methods like IsInteger, IsSigned, IsPtrShaped, etc. that currently can only be used on specific types (i.e., *Type), but many of these are really properties of type kinds (EType). This is annoying in parts of the compiler where we don't care about type identity anymore, but would still care about properties like signedness/etc.

I think we should change Type's Etype EType field into an embedding of EType and change these method's receiver parameters from *Type to EType.

Some need to stay on *Type though; notably IsEmptyInterface and IsUntyped, because they depend on properties of the specific type.

It's a bit redundant for the single-kind methods like IsMap to be moved to EType, but for consistency we might as well move them too.

Filing as an issue in case anyone objects or has alternative proposals.

@mdempsky mdempsky self-assigned this Aug 30, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Sep 6, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 11, 2016
@rsc rsc modified the milestones: Go1.9Early, Go1.8 Oct 21, 2016
@bradfitz bradfitz modified the milestones: Go1.10Early, Go1.9Early May 3, 2017
@bradfitz bradfitz added early-in-cycle A change that should be done early in the 3 month dev cycle. and removed early-in-cycle A change that should be done early in the 3 month dev cycle. labels Jun 14, 2017
@bradfitz bradfitz modified the milestones: Go1.10Early, Go1.10 Jun 14, 2017
@bradfitz bradfitz modified the milestones: Go1.10, Unplanned Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants