summaryrefslogtreecommitdiff
path: root/src/pkg/reflect/value.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-05-04 15:46:02 +0200
committerOndřej Surý <ondrej@sury.org>2011-05-04 15:46:02 +0200
commitad811fbb8897a9a3063274e927133915941f1dca (patch)
tree3df18657e50a0313ed6defcda30e4474cb28a467 /src/pkg/reflect/value.go
parent14cda8f405d55947c0a3fae0852b04af8405eae0 (diff)
downloadgolang-ad811fbb8897a9a3063274e927133915941f1dca.tar.gz
Imported Upstream version 2011.04.27upstream-weekly/2011.04.27
Diffstat (limited to 'src/pkg/reflect/value.go')
-rw-r--r--src/pkg/reflect/value.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go
index 2c2158a3c..6dffb0783 100644
--- a/src/pkg/reflect/value.go
+++ b/src/pkg/reflect/value.go
@@ -958,19 +958,14 @@ func (v Value) MapIndex(key Value) Value {
iv.mustBe(Map)
typ := iv.typ.toType()
- // Do not require ikey to be exported, so that DeepEqual
- // and other programs can use all the keys returned by
- // MapKeys as arguments to MapIndex. If either the map
- // or the key is unexported, though, the result will be
- // considered unexported.
-
ikey := key.internal()
+ ikey.mustBeExported()
ikey = convertForAssignment("reflect.Value.MapIndex", nil, typ.Key(), ikey)
if iv.word == 0 {
return Value{}
}
- flag := (iv.flag | ikey.flag) & flagRO
+ flag := iv.flag & flagRO
elemType := typ.Elem()
elemWord, ok := mapaccess(iv.word, ikey.word)
if !ok {