From 3e88a825df1f8a9afaf8a7e2ce79f0dc200d51ab Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Wed, 5 Jun 2013 11:19:26 +1000 Subject: [release-branch.go1.1] cmd/gc: fix missing slice/array types in export data. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ««« 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 --- src/cmd/gc/export.c | 1 + test/fixedbugs/issue5614.dir/rethinkgo.go | 16 ++++++++++++++++ test/fixedbugs/issue5614.dir/x.go | 7 +++++++ test/fixedbugs/issue5614.dir/y.go | 5 +++++ test/fixedbugs/issue5614.go | 11 +++++++++++ 5 files changed, 40 insertions(+) create mode 100644 test/fixedbugs/issue5614.dir/rethinkgo.go create mode 100644 test/fixedbugs/issue5614.dir/x.go create mode 100644 test/fixedbugs/issue5614.dir/y.go create mode 100644 test/fixedbugs/issue5614.go 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 -- cgit v1.2.3-54-g00ecf