When recursively calling walkexpr, r.Type is still the untyped value.
It then sometimes recursively calls finishcompare, which complains that
you can't compare the resulting expression to that untyped value.
Updates #23834.
Change-Id: I6b7acd3970ceaff8da9216bfa0ae24aca5dee828
Reviewed-on: https://go-review.googlesource.com/97856
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
// n.Left = finishcompare(n.Left, x, r, init)
func finishcompare(n, r *Node, init *Nodes) *Node {
r = typecheck(r, Erv)
+ r = conv(r, n.Type)
r = walkexpr(r, init)
- if r.Type != n.Type {
- r = nod(OCONVNOP, r, nil)
- r.Type = n.Type
- r = typecheck(r, Erv)
- }
return r
}