runtime, type switch: eliminate package global name space assumption

bonus: type switch now detects multiple uses of identical interface types.
bonus: interface types are now order-independent, following the spec.

R=ken2
CC=golang-dev
https://golang.org/cl/194053
This commit is contained in:
Russ Cox 2010-01-25 18:23:20 -08:00
parent 3b1a0355b6
commit 1912632019
17 changed files with 422 additions and 166 deletions

View file

@ -952,7 +952,7 @@ func (v *InterfaceValue) Method(i int) *FuncValue {
data := &value{Typeof((*byte)(nil)), addr(uintptr(v.addr) + ptrSize), true}
// Function pointer is at p.perm in the table.
fn := tab.Fn[p.perm]
fn := tab.Fn[i]
fv := &FuncValue{value: value{toType(*p.typ), addr(&fn), true}, first: data, isInterface: true}
return fv
}