cmd/compile: move most (*Type).IsFoo methods to (EType).IsFoo #16929
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
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
toEType
.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.
The text was updated successfully, but these errors were encountered: