mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 00:13:43 +00:00
reflect: panic on Type.CanSeq[2] instead of returning false
PR feedback.
This commit is contained in:
+6
-4
@@ -373,8 +373,9 @@ func (t *rawType) CanSeq() bool {
|
|||||||
case Int8, Int16, Int32, Int64, Int, Uint8, Uint16, Uint32, Uint64, Uint, Uintptr, Array, Slice, Chan, String, Map:
|
case Int8, Int16, Int32, Int64, Int, Uint8, Uint16, Uint32, Uint64, Uint, Uintptr, Array, Slice, Chan, String, Map:
|
||||||
return true
|
return true
|
||||||
case Func:
|
case Func:
|
||||||
return false // TODO: implement canRangeFunc
|
// TODO: implement canRangeFunc
|
||||||
// return canRangeFunc(&t.)
|
// return canRangeFunc(t)
|
||||||
|
panic("unimplemented: (reflect.Type).CanSeq() for functions")
|
||||||
case Pointer:
|
case Pointer:
|
||||||
return t.Elem().Kind() == Array
|
return t.Elem().Kind() == Array
|
||||||
}
|
}
|
||||||
@@ -386,8 +387,9 @@ func (t *rawType) CanSeq2() bool {
|
|||||||
case Array, Slice, String, Map:
|
case Array, Slice, String, Map:
|
||||||
return true
|
return true
|
||||||
case Func:
|
case Func:
|
||||||
return false // TODO: implement canRangeFunc2
|
// TODO: implement canRangeFunc2
|
||||||
// return canRangeFunc2(&t.t)
|
// return canRangeFunc2(t)
|
||||||
|
panic("unimplemented: (reflect.Type).CanSeq2() for functions")
|
||||||
case Pointer:
|
case Pointer:
|
||||||
return t.Elem().Kind() == Array
|
return t.Elem().Kind() == Array
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user