Skip to content

Commit c2af1d1

Browse files
ydnardeadprogram
authored andcommitted
reflect: panic on Type.CanSeq[2] instead of returning false
PR feedback.
1 parent 6465111 commit c2af1d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/reflect/type.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,9 @@ func (t *rawType) CanSeq() bool {
373373
case Int8, Int16, Int32, Int64, Int, Uint8, Uint16, Uint32, Uint64, Uint, Uintptr, Array, Slice, Chan, String, Map:
374374
return true
375375
case Func:
376-
return false // TODO: implement canRangeFunc
377-
// return canRangeFunc(&t.)
376+
// TODO: implement canRangeFunc
377+
// return canRangeFunc(t)
378+
panic("unimplemented: (reflect.Type).CanSeq() for functions")
378379
case Pointer:
379380
return t.Elem().Kind() == Array
380381
}
@@ -386,8 +387,9 @@ func (t *rawType) CanSeq2() bool {
386387
case Array, Slice, String, Map:
387388
return true
388389
case Func:
389-
return false // TODO: implement canRangeFunc2
390-
// return canRangeFunc2(&t.t)
390+
// TODO: implement canRangeFunc2
391+
// return canRangeFunc2(t)
392+
panic("unimplemented: (reflect.Type).CanSeq2() for functions")
391393
case Pointer:
392394
return t.Elem().Kind() == Array
393395
}

0 commit comments

Comments
 (0)