reflect: Value.Set: fix direction of assignment check

This commit is contained in:
Damian Gryski
2023-03-11 14:11:32 -08:00
committed by Ron Evans
parent 63c7a41337
commit 9c0bf8bd2c
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -907,7 +907,7 @@ func (it *MapIter) Next() bool {
func (v Value) Set(x Value) {
v.checkAddressable()
if !v.typecode.AssignableTo(x.typecode) {
if !x.typecode.AssignableTo(v.typecode) {
panic("reflect: cannot set")
}