gc: disallow map/func equality via interface comparison

Missed when I removed direct map/func equality.

R=ken2
CC=golang-dev
https://golang.org/cl/5452052
This commit is contained in:
Russ Cox 2011-12-06 10:48:17 -05:00
parent e4e4cdb39a
commit 46deaa297b
3 changed files with 42 additions and 4 deletions

View file

@ -468,8 +468,8 @@ func TestInterfaceValue(t *testing.T) {
func TestFunctionValue(t *testing.T) {
var x interface{} = func() {}
v := ValueOf(x)
if v.Interface() != v.Interface() || v.Interface() != x {
t.Fatalf("TestFunction != itself")
if fmt.Sprint(v.Interface()) != fmt.Sprint(x) {
t.Fatalf("TestFunction returned wrong pointer")
}
assert(t, v.Type().String(), "func()")
}