summaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2016-08-23 16:02:19 -0700
committerRobert Griesemer <gri@golang.org>2016-08-23 23:40:36 +0000
commit6394eb378eb6b2c0e691c519b2a6664f930b427e (patch)
treedb91b33802aab0f444cd09d41ab68ac163a94278 /test/fixedbugs
parenta8eb6d51bbd668b9e6fefa9f0cf39fccde3a305e (diff)
downloadgo-git-6394eb378eb6b2c0e691c519b2a6664f930b427e.tar.gz
cmd/compile: export package for _ (blank) struct fields
Blank struct fields are regular unexported fields. Two blank fields are different if they are from different packages. In order to correctly differentiate them, the compiler needs the package information. Add it to the export data. Fixes #15514. Change-Id: I421aaca22b542fcd0d66b2d2db777249cad78df6 Reviewed-on: https://go-review.googlesource.com/27639 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/issue15514.dir/a.go7
-rw-r--r--test/fixedbugs/issue15514.dir/b.go7
-rw-r--r--test/fixedbugs/issue15514.dir/c.go10
-rw-r--r--test/fixedbugs/issue15514.go7
4 files changed, 31 insertions, 0 deletions
diff --git a/test/fixedbugs/issue15514.dir/a.go b/test/fixedbugs/issue15514.dir/a.go
new file mode 100644
index 0000000000..663303b863
--- /dev/null
+++ b/test/fixedbugs/issue15514.dir/a.go
@@ -0,0 +1,7 @@
+// Copyright 2016 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.
+
+package a
+
+type A struct{ _ int32 }
diff --git a/test/fixedbugs/issue15514.dir/b.go b/test/fixedbugs/issue15514.dir/b.go
new file mode 100644
index 0000000000..f0750d3a44
--- /dev/null
+++ b/test/fixedbugs/issue15514.dir/b.go
@@ -0,0 +1,7 @@
+// Copyright 2016 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.
+
+package b
+
+func B() (_ struct{ _ int32 }) { return }
diff --git a/test/fixedbugs/issue15514.dir/c.go b/test/fixedbugs/issue15514.dir/c.go
new file mode 100644
index 0000000000..11624f9256
--- /dev/null
+++ b/test/fixedbugs/issue15514.dir/c.go
@@ -0,0 +1,10 @@
+// Copyright 2016 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.
+
+package c
+
+import "./a"
+import "./b"
+
+var _ a.A = b.B() // ERROR "cannot use b\.B"
diff --git a/test/fixedbugs/issue15514.go b/test/fixedbugs/issue15514.go
new file mode 100644
index 0000000000..626f7ad699
--- /dev/null
+++ b/test/fixedbugs/issue15514.go
@@ -0,0 +1,7 @@
+// errorcheckdir
+
+// Copyright 2016 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.
+
+package ignored