mirror of
https://github.com/golang/go
synced 2024-11-24 22:57:57 -07:00
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
This commit is contained in:
parent
5912869d61
commit
1cb7f85d74
@ -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;
|
||||
|
@ -1,12 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"./p"
|
||||
)
|
||||
|
||||
type T struct{ *p.S }
|
||||
|
||||
func main() {
|
||||
var t T
|
||||
p.F(t)
|
||||
}
|
24
test/fixedbugs/bug367.dir/main.go
Normal file
24
test/fixedbugs/bug367.dir/main.go
Normal file
@ -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")
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user