Skip to content

Commit

Permalink
reflect: AssignableTo check is better for the following Field(..).Set
Browse files Browse the repository at this point in the history
  • Loading branch information
wkhere committed Jun 1, 2024
1 parent 2ce5987 commit 434cd01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func copyBlock(v reflect.Value, block Block) error {
return copyBlock(v.Field(namei), x.(Block))
}

if st, bt := f.Type, vx.Type(); st != bt {
if st, bt := f.Type, vx.Type(); !bt.AssignableTo(st) {
return StructErr(
fmt.Sprintf(
"type mismatch for the mapped field: "+
Expand Down

0 comments on commit 434cd01

Please sign in to comment.