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
diff --git a/test/cmp3.go b/test/cmp3.go
index 06a67bd..1f53c07 100644
--- a/test/cmp3.go
+++ b/test/cmp3.go
@@ -10,7 +10,7 @@
func main()
{
- var b map[string]int;
+ var b []int;
var ib interface{} = b;
use(ib == ib);
}
diff --git a/test/cmp5.go b/test/cmp5.go
index 7500974..2a55f7b 100644
--- a/test/cmp5.go
+++ b/test/cmp5.go
@@ -8,7 +8,7 @@
func main()
{
- var b map[string]int;
+ var b []int;
var ib interface{} = b;
var m = make(map[interface{}] int);
m[ib] = 1;
diff --git a/test/convert.go b/test/convert.go
index 1b933f9..3790bf1 100644
--- a/test/convert.go
+++ b/test/convert.go
@@ -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 {
diff --git a/test/golden.out b/test/golden.out
index 3f15f48..bcbebb6 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -6,7 +6,7 @@
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 @@
panic PC=xxx
=========== ./cmp5.go
-hash of unhashable type map[string] int
+hash of unhashable type []int
throw: interface hash
panic PC=xxx