@@ -18,7 +18,7 @@ func (check *Checker) conversion(x *operand, T Type) {
1818 constArg := x .mode == constant_
1919
2020 constConvertibleTo := func (T Type , val * constant.Value ) bool {
21- switch t , _ := under ( T ).(* Basic ); {
21+ switch t , _ := T . Underlying ( ).(* Basic ); {
2222 case t == nil :
2323 // nothing to do
2424 case representableConst (x .val , check , t , val ):
@@ -142,8 +142,8 @@ func (x *operand) convertibleTo(check *Checker, T Type, cause *string) bool {
142142 origT := T
143143 V := Unalias (x .typ )
144144 T = Unalias (T )
145- Vu := under ( V )
146- Tu := under ( T )
145+ Vu := V . Underlying ( )
146+ Tu := T . Underlying ( )
147147 Vp , _ := V .(* TypeParam )
148148 Tp , _ := T .(* TypeParam )
149149
@@ -158,7 +158,7 @@ func (x *operand) convertibleTo(check *Checker, T Type, cause *string) bool {
158158 // and their pointer base types are not type parameters"
159159 if V , ok := V .(* Pointer ); ok {
160160 if T , ok := T .(* Pointer ); ok {
161- if IdenticalIgnoreTags (under ( V .base ), under ( T .base )) && ! isTypeParam (V .base ) && ! isTypeParam (T .base ) {
161+ if IdenticalIgnoreTags (V .base . Underlying ( ), T .base . Underlying ( )) && ! isTypeParam (V .base ) && ! isTypeParam (T .base ) {
162162 return true
163163 }
164164 }
@@ -211,7 +211,7 @@ func (x *operand) convertibleTo(check *Checker, T Type, cause *string) bool {
211211 return false
212212 }
213213 case * Pointer :
214- if a , _ := under ( a .Elem ()).(* Array ); a != nil {
214+ if a , _ := a .Elem (). Underlying ( ).(* Array ); a != nil {
215215 if Identical (s .Elem (), a .Elem ()) {
216216 if check == nil || check .allowVersion (go1_17 ) {
217217 return true
@@ -292,23 +292,23 @@ func (x *operand) convertibleTo(check *Checker, T Type, cause *string) bool {
292292}
293293
294294func isUintptr (typ Type ) bool {
295- t , _ := under ( typ ).(* Basic )
295+ t , _ := typ . Underlying ( ).(* Basic )
296296 return t != nil && t .kind == Uintptr
297297}
298298
299299func isUnsafePointer (typ Type ) bool {
300- t , _ := under ( typ ).(* Basic )
300+ t , _ := typ . Underlying ( ).(* Basic )
301301 return t != nil && t .kind == UnsafePointer
302302}
303303
304304func isPointer (typ Type ) bool {
305- _ , ok := under ( typ ).(* Pointer )
305+ _ , ok := typ . Underlying ( ).(* Pointer )
306306 return ok
307307}
308308
309309func isBytesOrRunes (typ Type ) bool {
310- if s , _ := under ( typ ).(* Slice ); s != nil {
311- t , _ := under ( s .elem ).(* Basic )
310+ if s , _ := typ . Underlying ( ).(* Slice ); s != nil {
311+ t , _ := s .elem . Underlying ( ).(* Basic )
312312 return t != nil && (t .kind == Byte || t .kind == Rune )
313313 }
314314 return false
0 commit comments