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.
The text was updated successfully, but these errors were encountered: