]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: use nil instead of syntax.ImplicitOne
authorRobert Griesemer <gri@golang.org>
Thu, 21 Jan 2021 01:03:36 +0000 (17:03 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 21 Jan 2021 06:55:47 +0000 (06:55 +0000)
commit18bd7aa62581f313c86164d763b1e246307888a9
tree635a5e70ed41388129ac991812c06985e032fa00
parent2427f6e6c07de20a00dd8b9ab464f0abe5ccd13a
[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>
src/cmd/compile/internal/noder/expr.go
src/cmd/compile/internal/noder/noder.go
src/cmd/compile/internal/noder/stmt.go
src/cmd/compile/internal/syntax/nodes.go
src/cmd/compile/internal/syntax/parser.go
src/cmd/compile/internal/syntax/printer.go
src/cmd/compile/internal/syntax/walk.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/pos.go
src/cmd/compile/internal/types2/stmt.go