For #60088
Change-Id: Id19435e864bcfd2adbb1492db3f8cdf2ee3c915e
Reviewed-on: https://go-review.googlesource.com/c/go/+/515175
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
// There's no easy way to map from an ast.Expr to all the places that use them, so
// we use reflect to find all such references.
if len(badNils) > 0 {
- exprType := reflect.TypeOf((*ast.Expr)(nil)).Elem()
- exprSliceType := reflect.TypeOf(([]ast.Expr)(nil))
+ exprType := reflect.TypeFor[ast.Expr]()
+ exprSliceType := reflect.TypeFor[[]ast.Expr]()
walk(f, func(n any) {
if n == nil {
return