After CL 281543, checkassign do not have to check assignment in range
loop anymore, thus its first parameter is un-used.
Change-Id: Idbc46fcb81c3dd5edc87308d228c1a15ca5faf7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/396615
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
base.ErrorfAt(n.Pos(), "cannot assign type %v to %L in range%s", t, nn, why)
}
}
- checkassign(n, nn)
+ checkassign(nn)
}
}
do(n.Key, tk)
if lhs[i].Typecheck() == 0 {
lhs[i] = AssignExpr(lhs[i])
}
- checkassign(stmt, lhs[i])
+ checkassign(lhs[i])
}
assignType := func(i int, typ *types.Type) {
case ir.OASOP:
n := n.(*ir.AssignOpStmt)
n.X, n.Y = Expr(n.X), Expr(n.Y)
- checkassign(n, n.X)
+ checkassign(n.X)
if n.IncDec && !okforarith[n.X.Type().Kind()] {
base.Errorf("invalid operation: %v (non-numeric type %v)", n, n.X.Type())
return n
}
}
-func checkassign(stmt ir.Node, n ir.Node) {
+func checkassign(n ir.Node) {
// have already complained about n being invalid
if n.Type() == nil {
if base.Errors() == 0 {