aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2023-03-11 14:12:03 -0800
committerRon Evans <[email protected]>2023-03-25 22:32:29 +0100
commitadaa7ca27aacdb782d971980aa424a411bd48e56 (patch)
tree46a218c907e4f8104b65572185386fddf5c9cdd4
parenta5ddc688450368205658b61a99b6e23757b47967 (diff)
downloadtinygo-adaa7ca27aacdb782d971980aa424a411bd48e56.tar.gz
tinygo-adaa7ca27aacdb782d971980aa424a411bd48e56.zip
reflect: SetMapIndex: use AssignableTo() instead of type equality
-rw-r--r--src/reflect/value.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/value.go b/src/reflect/value.go
index 0b7a5701b..d25469603 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -1366,7 +1366,7 @@ func (v Value) SetMapIndex(key, elem Value) {
// if elem is the zero Value, it means delete
del := elem == Value{}
- if !del && elem.typecode != v.typecode.elem() {
+ if !del && !elem.typecode.AssignableTo(v.typecode.elem()) {
panic("reflect.Value.SetMapIndex: incompatible types for value")
}