File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ func mustArrayToByteSlice(value reflect.Value) reflect.Value {
99
99
func set (dst , src reflect.Value ) error {
100
100
dstType , srcType := dst .Type (), src .Type ()
101
101
switch {
102
- case dstType .Kind () == reflect .Interface && dst .Elem ().IsValid ():
102
+ case dstType .Kind () == reflect .Interface && dst .Elem ().IsValid () && ( dst . Elem (). Type (). Kind () == reflect . Ptr || dst . Elem (). CanSet ()) :
103
103
return set (dst .Elem (), src )
104
104
case dstType .Kind () == reflect .Ptr && dstType .Elem () != reflect .TypeOf (big.Int {}):
105
105
return set (dst .Elem (), src )
Original file line number Diff line number Diff line change @@ -352,6 +352,11 @@ func TestMethodMultiReturn(t *testing.T) {
352
352
& []interface {}{& expected .Int , & expected .String },
353
353
"" ,
354
354
"Can unpack into a slice" ,
355
+ }, {
356
+ & []interface {}{& bigint , "" },
357
+ & []interface {}{& expected .Int , expected .String },
358
+ "" ,
359
+ "Can unpack into a slice without indirection" ,
355
360
}, {
356
361
& [2 ]interface {}{& bigint , new (string )},
357
362
& [2 ]interface {}{& expected .Int , & expected .String },
You can’t perform that action at this time.
0 commit comments