aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2013-06-05 11:19:26 +1000
committerAndrew Gerrand <adg@golang.org>2013-06-05 11:19:26 +1000
commit3e88a825df1f8a9afaf8a7e2ce79f0dc200d51ab (patch)
tree2322bef9e289cffd6415ed94b4c60bbc058ce33c
parentd72c550f1c7e13c323f4507b57d741ed00f0b0cd (diff)
downloadgo-3e88a825df1f8a9afaf8a7e2ce79f0dc200d51ab.tar.gz
go-3e88a825df1f8a9afaf8a7e2ce79f0dc200d51ab.zip
[release-branch.go1.1] cmd/gc: fix missing slice/array types in export data.
««« CL 9953044 / 0e1b2f7384d2 cmd/gc: fix missing slice/array types in export data. Fixes #5614. R=golang-dev CC=golang-dev https://golang.org/cl/9953044 »»» R=iant, remyoudompheng, dsymonds CC=golang-dev https://golang.org/cl/10033043
-rw-r--r--src/cmd/gc/export.c1
-rw-r--r--test/fixedbugs/issue5614.dir/rethinkgo.go16
-rw-r--r--test/fixedbugs/issue5614.dir/x.go7
-rw-r--r--test/fixedbugs/issue5614.dir/y.go5
-rw-r--r--test/fixedbugs/issue5614.go11
5 files changed, 40 insertions, 0 deletions
diff --git a/src/cmd/gc/export.c b/src/cmd/gc/export.c
index d7b46b1145..4a9b8c8ba3 100644
--- a/src/cmd/gc/export.c
+++ b/src/cmd/gc/export.c
@@ -164,6 +164,7 @@ reexportdep(Node *n)
case ODOTTYPE:
case ODOTTYPE2:
case OSTRUCTLIT:
+ case OARRAYLIT:
case OPTRLIT:
case OMAKEMAP:
case OMAKESLICE:
diff --git a/test/fixedbugs/issue5614.dir/rethinkgo.go b/test/fixedbugs/issue5614.dir/rethinkgo.go
new file mode 100644
index 0000000000..4ae66d679e
--- /dev/null
+++ b/test/fixedbugs/issue5614.dir/rethinkgo.go
@@ -0,0 +1,16 @@
+package rethinkgo
+
+type Session struct {
+}
+
+func (s *Session) Run(query Exp) *int { return nil }
+
+type List []interface{}
+
+type Exp struct {
+ args []interface{}
+}
+
+func (e Exp) UseOutdated(useOutdated bool) Exp {
+ return Exp{args: List{e, useOutdated}}
+}
diff --git a/test/fixedbugs/issue5614.dir/x.go b/test/fixedbugs/issue5614.dir/x.go
new file mode 100644
index 0000000000..7e4f3a7e6b
--- /dev/null
+++ b/test/fixedbugs/issue5614.dir/x.go
@@ -0,0 +1,7 @@
+package x
+
+import "./rethinkgo"
+
+var S *rethinkgo.Session
+
+
diff --git a/test/fixedbugs/issue5614.dir/y.go b/test/fixedbugs/issue5614.dir/y.go
new file mode 100644
index 0000000000..97cc93a79d
--- /dev/null
+++ b/test/fixedbugs/issue5614.dir/y.go
@@ -0,0 +1,5 @@
+package y
+
+import "./x"
+
+var T = x.S
diff --git a/test/fixedbugs/issue5614.go b/test/fixedbugs/issue5614.go
new file mode 100644
index 0000000000..f2518d2a0c
--- /dev/null
+++ b/test/fixedbugs/issue5614.go
@@ -0,0 +1,11 @@
+// compiledir
+
+// Copyright 2013 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.
+
+// Issue 5614: exported data for inlining may miss
+// named types when used in implicit conversion to
+// their underlying type.
+
+package ignored