aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2020-11-20 14:09:01 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2020-11-20 17:31:50 +0000
commitc306fd6d0b208f67208fb4a1b5bb82e0338a080c (patch)
tree3ba89bd0ab199836685244ebef79b83215e257b8 /test
parent5e58ae43bedeae5964e668755049088938320740 (diff)
downloadgo-c306fd6d0b208f67208fb4a1b5bb82e0338a080c.tar.gz
go-c306fd6d0b208f67208fb4a1b5bb82e0338a080c.zip
cmd/compile: allow loading single field of typed-interface{} OpIData
Same reason as CL 270057, but for OpLoad. Fixes #42727 Change-Id: Iebb1a8110f29427a0aed3b5e3e84f0540de3d1b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/271906 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue42727.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/fixedbugs/issue42727.go b/test/fixedbugs/issue42727.go
new file mode 100644
index 0000000000..40081708b1
--- /dev/null
+++ b/test/fixedbugs/issue42727.go
@@ -0,0 +1,23 @@
+// compile
+
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Ensure that late expansion correctly handles an OpLoad with type interface{}
+
+package p
+
+type iface interface {
+ m()
+}
+
+type it interface{}
+
+type makeIface func() iface
+
+func f() {
+ var im makeIface
+ e := im().(it)
+ _ = &e
+}