mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
reflect: SetMapIndex: use AssignableTo() instead of type equality
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user