diff --git a/go/types/typeutil/map.go b/go/types/typeutil/map.go index 010df20c..69c3f135 100644 --- a/go/types/typeutil/map.go +++ b/go/types/typeutil/map.go @@ -9,7 +9,7 @@ package typeutil import ( "bytes" "fmt" - "unsafe" + "reflect" "code.google.com/p/go.tools/go/types" ) @@ -295,7 +295,7 @@ func (h Hasher) hashFor(t types.Type) uint32 { case *types.Named: // Not safe with a copying GC; objects may move. - return uint32(uintptr(unsafe.Pointer(t.Obj()))) + return uint32(reflect.ValueOf(t.Obj()).Pointer()) case *types.Tuple: return h.hashTuple(t)