]> Cypherpunks repositories - gostls13.git/commitdiff
gc: 0 expected bugs
authorRuss Cox <rsc@golang.org>
Fri, 9 Dec 2011 19:58:28 +0000 (14:58 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 9 Dec 2011 19:58:28 +0000 (14:58 -0500)
Now that Luuk's qualified exporting code
is in, fixing this bug is trivial.

R=ken2
CC=golang-dev
https://golang.org/cl/5479048

src/cmd/gc/subr.c
test/bugs/bug367.dir/main.go [deleted file]
test/fixedbugs/bug367.dir/main.go [new file with mode: 0644]
test/fixedbugs/bug367.dir/p.go [moved from test/bugs/bug367.dir/p.go with 61% similarity]
test/fixedbugs/bug367.go [moved from test/bugs/bug367.go with 94% similarity]
test/golden.out

index 71e67f14496120e1aa769bb67f0bb816d586b5bd..7c28cfd176160077f3427f985e270cbbee67e284 100644 (file)
@@ -1964,7 +1964,7 @@ lookdot0(Sym *s, Type *t, Type **save, int ignorecase)
        return c;
 }
 
-// search depth d --
+// search depth d for field/method s --
 // return count of fields+methods
 // found at search depth.
 // answer is in dotlist array and
@@ -2087,8 +2087,6 @@ expand0(Type *t, int followptr)
 
        if(u->etype == TINTER) {
                for(f=u->type; f!=T; f=f->down) {
-                       if(!exportname(f->sym->name) && f->sym->pkg != localpkg)
-                               continue;
                        if(f->sym->flags & SymUniq)
                                continue;
                        f->sym->flags |= SymUniq;
@@ -2104,8 +2102,6 @@ expand0(Type *t, int followptr)
        u = methtype(t);
        if(u != T) {
                for(f=u->method; f!=T; f=f->down) {
-                       if(!exportname(f->sym->name) && f->sym->pkg != localpkg)
-                               continue;
                        if(f->sym->flags & SymUniq)
                                continue;
                        f->sym->flags |= SymUniq;
diff --git a/test/bugs/bug367.dir/main.go b/test/bugs/bug367.dir/main.go
deleted file mode 100644 (file)
index ab5d170..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package main
-
-import (
-       "./p"
-)
-
-type T struct{ *p.S }
-
-func main() {
-       var t T
-       p.F(t)
-}
diff --git a/test/fixedbugs/bug367.dir/main.go b/test/fixedbugs/bug367.dir/main.go
new file mode 100644 (file)
index 0000000..21e9a50
--- /dev/null
@@ -0,0 +1,24 @@
+package main
+
+import (
+       "./p"
+)
+
+type T struct{ *p.S }
+type I interface {
+       get()
+}
+
+func main() {
+       var t T
+       p.F(t)
+       var x interface{} = t
+       _, ok := x.(I)
+       if ok {
+               panic("should not satisfy main.I")
+       }
+       _, ok = x.(p.I)
+       if !ok {
+               panic("should satisfy p.I")
+       }
+}
similarity index 61%
rename from test/bugs/bug367.dir/p.go
rename to test/fixedbugs/bug367.dir/p.go
index 4e27d4e00af125024835936bba61b0cdfbf06285..c8772d2d051543b217f55130aa0d74ec115905c4 100644 (file)
@@ -3,14 +3,13 @@ package p
 type T struct{ x int }
 type S struct{}
 
-func (p *S) get() T {
-       return T{0}
+func (p *S) get() {
 }
 
 type I interface {
-       get() T
+       get()
 }
 
 func F(i I) {
-       _ = i.get()
+       i.get()
 }
similarity index 94%
rename from test/bugs/bug367.go
rename to test/fixedbugs/bug367.go
index 073e3b180ec1af6b688ad12de9cc110608bf93dd..25d11a15318d1be22c91aa2b57fc60f25d2b2f9e 100644 (file)
@@ -4,4 +4,4 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-ignored
+package ignored
index f2e7f5ce3043eda283d02c9c6cd3d598b06e5241..6dccb6ec01d7e6e89c0b6f0fb687de5b8f33c044 100644 (file)
@@ -119,7 +119,3 @@ broke
 0x0
 
 == bugs/
-
-=========== bugs/bug367.go
-panic: interface conversion: main.T is not p.I: missing method get
-BUG: should not fail