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 {
9999func set (dst , src reflect.Value ) error {
100100 dstType , srcType := dst .Type (), src .Type ()
101101 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 ()) :
103103 return set (dst .Elem (), src )
104104 case dstType .Kind () == reflect .Ptr && dstType .Elem () != reflect .TypeOf (big.Int {}):
105105 return set (dst .Elem (), src )
Original file line number Diff line number Diff line change @@ -352,6 +352,11 @@ func TestMethodMultiReturn(t *testing.T) {
352352 & []interface {}{& expected .Int , & expected .String },
353353 "" ,
354354 "Can unpack into a slice" ,
355+ }, {
356+ & []interface {}{& bigint , "" },
357+ & []interface {}{& expected .Int , expected .String },
358+ "" ,
359+ "Can unpack into a slice without indirection" ,
355360 }, {
356361 & [2 ]interface {}{& bigint , new (string )},
357362 & [2 ]interface {}{& expected .Int , & expected .String },
You can’t perform that action at this time.
0 commit comments