Commit 1cb7f85d authored by Russ Cox's avatar Russ Cox

gc: 0 expected bugs

Now that Luuk's qualified exporting code
is in, fixing this bug is trivial.

R=ken2
CC=golang-dev
https://golang.org/cl/5479048
parent 5912869d
......@@ -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;
......
......@@ -5,8 +5,20 @@ import (
)
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")
}
}
......@@ -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()
}
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment