diff --git a/src/cmd/compile/internal/typecheck/stmt.go b/src/cmd/compile/internal/typecheck/stmt.go index 16e24a04917..60bac77d19c 100644 --- a/src/cmd/compile/internal/typecheck/stmt.go +++ b/src/cmd/compile/internal/typecheck/stmt.go @@ -78,7 +78,7 @@ func typecheckrangeExpr(n *ir.RangeStmt) { 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) @@ -137,7 +137,7 @@ func assign(stmt ir.Node, lhs, rhs []ir.Node) { if lhs[i].Typecheck() == 0 { lhs[i] = AssignExpr(lhs[i]) } - checkassign(stmt, lhs[i]) + checkassign(lhs[i]) } assignType := func(i int, typ *types.Type) { diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go index b5108eab847..85de653a82a 100644 --- a/src/cmd/compile/internal/typecheck/typecheck.go +++ b/src/cmd/compile/internal/typecheck/typecheck.go @@ -488,7 +488,7 @@ func typecheck1(n ir.Node, top int) ir.Node { 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 @@ -1562,7 +1562,7 @@ func checklvalue(n ir.Node, verb string) { } } -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 {