mirror of
https://github.com/golang/go.git
synced 2025-10-26 22:34:12 +00:00
[dev.typeparams] cmd/compile: use nil instead of syntax.ImplicitOne
Represent x++/-- as x +=/-= with the RHS of the assignment being nil rather than syntax.ImplicitOne. Dependent code already had to check for syntax.ImplicitOne, but then shared some existing code for regular assignment operations. Now always handle this case fully explicit, which simplifies the code. Change-Id: I28c7918153c27cbbf97b041d0c85ff027c58687c Reviewed-on: https://go-review.googlesource.com/c/go/+/285172 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
2427f6e6c0
commit
18bd7aa625
10 changed files with 48 additions and 53 deletions
|
|
@ -19,10 +19,6 @@ func (g *irgen) expr(expr syntax.Expr) ir.Node {
|
|||
return nil
|
||||
}
|
||||
|
||||
if expr == syntax.ImplicitOne {
|
||||
base.Fatalf("expr of ImplicitOne")
|
||||
}
|
||||
|
||||
if expr, ok := expr.(*syntax.Name); ok && expr.Value == "_" {
|
||||
return ir.BlankNode
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue