mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
e4e4cdb39a
commit
46deaa297b
3 changed files with 42 additions and 4 deletions
|
|
@ -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()")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue