~goyaml/goyaml/trunk

« back to all changes in this revision

Viewing changes to decode.go

Unbreak goyaml after interface mutability fix in reflect.

R=rog
CC=
https://codereview.appspot.com/5784060

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
        if set := d.setter("!!seq", &out, &good); set != nil {
376
376
                defer set()
377
377
        }
 
378
        var iface reflect.Value
378
379
        if out.Kind() == reflect.Interface {
379
380
                // No type hints. Will have to use a generic sequence.
380
 
                iface := out
 
381
                iface = out
381
382
                out = settableValueOf(make([]interface{}, 0))
382
 
                iface.Set(out)
383
383
        }
384
384
 
385
385
        if out.Kind() != reflect.Slice {
394
394
                        out.Set(reflect.Append(out, e))
395
395
                }
396
396
        }
 
397
        if iface.IsValid() {
 
398
                iface.Set(out)
 
399
        }
397
400
        return true
398
401
}
399
402