Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(138)

Unified Diff: src/pkg/rpc/server.go

Issue 4301043: update tree for reflect changes (Closed)
Patch Set: diff -r f692a5e90f6f https://go.googlecode.com/hg/ Created 13 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/netchan/import.go ('k') | src/pkg/template/template.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/rpc/server.go
===================================================================
--- a/src/pkg/rpc/server.go
+++ b/src/pkg/rpc/server.go
@@ -133,13 +133,13 @@
// Precompute the reflect type for os.Error. Can't use os.Error directly
// because Typeof takes an empty interface value. This is annoying.
var unusedError *os.Error
-var typeOfOsError = reflect.Typeof(unusedError).(*reflect.PtrType).Elem()
+var typeOfOsError = reflect.Typeof(unusedError).Elem()
type methodType struct {
sync.Mutex // protects counters
method reflect.Method
- ArgType *reflect.PtrType
- ReplyType *reflect.PtrType
+ ArgType reflect.Type
+ ReplyType reflect.Type
numCalls uint
}
@@ -252,13 +252,14 @@
log.Println("method", mname, "has wrong number of ins:", mtype.NumIn())
continue
}
- argType, ok := mtype.In(1).(*reflect.PtrType)
+ argType := mtype.In(1)
+ ok := argType.Kind() == reflect.Ptr
if !ok {
log.Println(mname, "arg type not a pointer:", mtype.In(1))
continue
}
- replyType, ok := mtype.In(2).(*reflect.PtrType)
- if !ok {
+ replyType := mtype.In(2)
+ if replyType.Kind() != reflect.Ptr {
log.Println(mname, "reply type not a pointer:", mtype.In(2))
continue
}
@@ -296,7 +297,7 @@
var invalidRequest = InvalidRequest{}
-func _new(t *reflect.PtrType) *reflect.PtrValue {
+func _new(t reflect.Type) *reflect.PtrValue {
v := reflect.MakeZero(t).(*reflect.PtrValue)
v.PointTo(reflect.MakeZero(t.Elem()))
return v
« no previous file with comments | « src/pkg/netchan/import.go ('k') | src/pkg/template/template.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b