compiler: add support for GODEBUG=gotypesalias=1

Since we now require Go 1.22, this became a lot simpler (since we can
now refer to `types.Alias` and `types.Unalias`).
This commit is contained in:
Ayke van Laethem
2025-05-24 14:38:09 +02:00
committed by Ron Evans
parent 3f4f4e0ead
commit 2e043c7fbc
4 changed files with 27 additions and 9 deletions
+1 -3
View File
@@ -248,7 +248,7 @@ func (b *builder) createMapIteratorNext(rangeVal ssa.Value, llvmRangeVal, it llv
// can be compared with runtime.memequal. Note that padding bytes are undef
// and can alter two "equal" structs being equal when compared with memequal.
func hashmapIsBinaryKey(keyType types.Type) bool {
switch keyType := keyType.(type) {
switch keyType := keyType.Underlying().(type) {
case *types.Basic:
return keyType.Info()&(types.IsBoolean|types.IsInteger) != 0
case *types.Pointer:
@@ -263,8 +263,6 @@ func hashmapIsBinaryKey(keyType types.Type) bool {
return true
case *types.Array:
return hashmapIsBinaryKey(keyType.Elem())
case *types.Named:
return hashmapIsBinaryKey(keyType.Underlying())
default:
return false
}