diff options
author | Matthew Dempsky <mdempsky@google.com> | 2019-09-24 23:56:50 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2019-09-25 17:07:09 +0000 |
commit | efb9739203fc0b66f5593c5edbe0bc0fd6062956 (patch) | |
tree | cb646e4e30298ea902f9fc6f8741d3c47ca41542 /test/escape_iface.go | |
parent | 3e428363c4b793c552925703f206b9382fdfcb51 (diff) | |
download | go-efb9739203fc0b66f5593c5edbe0bc0fd6062956.tar.gz go-efb9739203fc0b66f5593c5edbe0bc0fd6062956.zip |
cmd/compile: use underlying OCOMPLIT's position for OPTRLIT
Currently, when we create an OPTRLIT node, it defaults to the
OCOMPLIT's final element's position. But it improves error messages to
use the OCOMPLIT's own position instead.
Change-Id: Ibb031f543c7248d88d99fd0737685e01d86e2500
Reviewed-on: https://go-review.googlesource.com/c/go/+/197119
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'test/escape_iface.go')
-rw-r--r-- | test/escape_iface.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/escape_iface.go b/test/escape_iface.go index 898f504b31..118ed3c56f 100644 --- a/test/escape_iface.go +++ b/test/escape_iface.go @@ -220,8 +220,8 @@ type T2 struct { func dotTypeEscape() *T2 { // #11931 var x interface{} x = &T1{p: new(int)} // ERROR "new\(int\) escapes to heap" "&T1 literal does not escape" - return &T2{ - T1: *(x.(*T1)), // ERROR "&T2 literal escapes to heap" + return &T2{ // ERROR "&T2 literal escapes to heap" + T1: *(x.(*T1)), } } |