summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-04-21 08:14:50 -0400
committerRuss Cox <rsc@golang.org>2011-04-21 08:14:50 -0400
commit3205144ca03d7b93e818ceade5d755de26bdc865 (patch)
tree5ad400be29e8d00c0a3c224413862bda5ecd165f /test
parent31f1c983a27b668ebd95cebced0ee9ab44babbc7 (diff)
downloadgo-3205144ca03d7b93e818ceade5d755de26bdc865.tar.gz
gc: correct handling of unexported method names in embedded interfaces
go/types: update for export data format change reflect: require package qualifiers to match during interface check runtime: require package qualifiers to match during interface check test: fixed bug324, adapt to be silent Fixes issue 1550. Issue 1536 remains open. R=gri, ken2, r CC=golang-dev http://codereview.appspot.com/4442071
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug324.dir/main.go (renamed from test/bugs/bug324.dir/main.go)7
-rw-r--r--test/fixedbugs/bug324.dir/p.go (renamed from test/bugs/bug324.dir/p.go)0
-rw-r--r--test/fixedbugs/bug324.go (renamed from test/bugs/bug324.go)2
-rw-r--r--test/golden.out5
4 files changed, 7 insertions, 7 deletions
diff --git a/test/bugs/bug324.dir/main.go b/test/fixedbugs/bug324.dir/main.go
index 4c1a18d9c..3ab61f3eb 100644
--- a/test/bugs/bug324.dir/main.go
+++ b/test/fixedbugs/bug324.dir/main.go
@@ -14,7 +14,7 @@ type Exported interface {
type Implementation struct{}
-func (p *Implementation) private() { println("main.Implementation.private()") }
+func (p *Implementation) private() {}
func main() {
@@ -40,7 +40,12 @@ func main() {
// x = px
// this assignment unexpectedly compiles and then executes
+ defer func() {
+ recover()
+ }()
x = px.(Exported)
+
+ println("should not get this far")
// this is a legitimate call, but because of the previous assignment,
// it invokes the method private in p!
diff --git a/test/bugs/bug324.dir/p.go b/test/fixedbugs/bug324.dir/p.go
index d1e3b991a..d1e3b991a 100644
--- a/test/bugs/bug324.dir/p.go
+++ b/test/fixedbugs/bug324.dir/p.go
diff --git a/test/bugs/bug324.go b/test/fixedbugs/bug324.go
index e188515d7..3da75630a 100644
--- a/test/bugs/bug324.go
+++ b/test/fixedbugs/bug324.go
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ! ./$A.out || echo BUG: should fail
+// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
diff --git a/test/golden.out b/test/golden.out
index bbe399f28..725e8de44 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -166,8 +166,3 @@ panic: interface conversion: interface is main.T, not main.T
bugs/bug322.dir/main.go:19: implicit assignment of unexported field 'x' of lib.T in method receiver
bugs/bug322.dir/main.go:32: implicit assignment of unexported field 'x' of lib.T in method receiver
BUG: fails incorrectly
-
-=========== bugs/bug324.go
-main.Implementation.private()
-p.Implementation.private()
-BUG: should fail