]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: fix escape printout bugs for -G=3
authorDan Scales <danscales@google.com>
Wed, 14 Jul 2021 05:21:54 +0000 (22:21 -0700)
committerDan Scales <danscales@google.com>
Wed, 14 Jul 2021 21:58:10 +0000 (21:58 +0000)
commite3e6cd30221185d6e4fa76f109f96fdede580729
tree7457c8f438c9633f7a1f29f5c9e84f3d1201ea2a
parent2b10d7ff0be9ee5ebe1856349714f78936bf059d
[dev.typeparams] cmd/compile: fix escape printout bugs for -G=3

Call SetPos() in g.expr() so it is available for any new nodes.

Print out the actual type for a composite literal in exprFmt() if
available, else use Ntype if available. Seems generally useful, since
the type name is always more useful than just 'composite literal'.

Fixes a bunch of cases that are excluded in run.go for -G=3.

Change-Id: I40b9bba88027ea4f36d419e3989e7f14891bea04
Reviewed-on: https://go-review.googlesource.com/c/go/+/334609
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/noder/expr.go
test/run.go