While at it, make "typekind" awares of "types.Ideal*" types.
Passes toolstash-check.
Change-Id: I092fa8c57ab6b8d9ba0f25d8e1ea44fba48675e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/256438
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
}
func typekind(t *types.Type) string {
- if t.IsSlice() {
- return "slice"
+ if t.IsUntyped() {
+ return fmt.Sprintf("%v", t)
}
et := t.Etype
if int(et) < len(_typekind) {
t = mixUntyped(l.Type, r.Type)
}
if dt := defaultType(t); !okfor[op][dt.Etype] {
- yyerror("invalid operation: %v (operator %v not defined on %v)", n, op, t)
+ yyerror("invalid operation: %v (operator %v not defined on %s)", n, op, typekind(t))
n.Type = nil
return n
}