Skip to content

Commit 6327c16

Browse files
committed
compiler/natives/src/reflect: fix reflect.Set kind Struct by flagIndir
1 parent beff8ba commit 6327c16

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/natives/src/reflect/reflect.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,12 +1436,10 @@ func (v Value) Set(x Value) {
14361436
x = x.assignTo("reflect.Set", v.typ, nil)
14371437
if v.flag&flagIndir != 0 {
14381438
switch v.typ.Kind() {
1439-
case Array:
1439+
case Array, Struct:
14401440
jsType(v.typ).Call("copy", js.InternalObject(v.ptr), js.InternalObject(x.ptr))
14411441
case Interface:
14421442
js.InternalObject(v.ptr).Call("$set", js.InternalObject(valueInterface(x, false)))
1443-
case Struct:
1444-
copyStruct(js.InternalObject(v.ptr), js.InternalObject(x.ptr), v.typ)
14451443
default:
14461444
js.InternalObject(v.ptr).Call("$set", x.object())
14471445
}

0 commit comments

Comments
 (0)