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

maps have == so maps should work as map keys.

fix tests of bad map keys to use slices instead.

R=r
DELTA=7  (0 added, 1 deleted, 6 changed)
OCL=31123
CL=31145
parent 75fe1303
......@@ -10,7 +10,7 @@ func use(bool) { }
func main()
{
var b map[string]int;
var b []int;
var ib interface{} = b;
use(ib == ib);
}
......@@ -8,7 +8,7 @@ package main
func main()
{
var b map[string]int;
var b []int;
var ib interface{} = b;
var m = make(map[interface{}] int);
m[ib] = 1;
......
......@@ -6,11 +6,10 @@
package main
import "unsafe"
import "reflect"
func typeof(x interface{}) string {
val, typ, indir := unsafe.Reflect(x);
return typ;
return reflect.Typeof(x).String();
}
func f() int {
......
......@@ -6,7 +6,7 @@ throw: interface compare
panic PC=xxx
=========== ./cmp3.go
comparing uncomparable type map[string] int
comparing uncomparable type []int
throw: interface compare
panic PC=xxx
......@@ -18,7 +18,7 @@ throw: interface hash
panic PC=xxx
=========== ./cmp5.go
hash of unhashable type map[string] int
hash of unhashable type []int
throw: interface hash
panic PC=xxx
......
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