func (t *rtype) ChanDir() ChanDir {
if t.Kind() != Chan {
- panic("reflect: ChanDir of non-chan type")
+ panic("reflect: ChanDir of non-chan type " + t.String())
}
tt := (*chanType)(unsafe.Pointer(t))
return ChanDir(tt.dir)
func (t *rtype) IsVariadic() bool {
if t.Kind() != Func {
- panic("reflect: IsVariadic of non-func type")
+ panic("reflect: IsVariadic of non-func type " + t.String())
}
tt := (*funcType)(unsafe.Pointer(t))
return tt.outCount&(1<<15) != 0
tt := (*sliceType)(unsafe.Pointer(t))
return toType(tt.elem)
}
- panic("reflect: Elem of invalid type")
+ panic("reflect: Elem of invalid type " + t.String())
}
func (t *rtype) Field(i int) StructField {
if t.Kind() != Struct {
- panic("reflect: Field of non-struct type")
+ panic("reflect: Field of non-struct type " + t.String())
}
tt := (*structType)(unsafe.Pointer(t))
return tt.Field(i)
func (t *rtype) FieldByIndex(index []int) StructField {
if t.Kind() != Struct {
- panic("reflect: FieldByIndex of non-struct type")
+ panic("reflect: FieldByIndex of non-struct type " + t.String())
}
tt := (*structType)(unsafe.Pointer(t))
return tt.FieldByIndex(index)
func (t *rtype) FieldByName(name string) (StructField, bool) {
if t.Kind() != Struct {
- panic("reflect: FieldByName of non-struct type")
+ panic("reflect: FieldByName of non-struct type " + t.String())
}
tt := (*structType)(unsafe.Pointer(t))
return tt.FieldByName(name)
func (t *rtype) FieldByNameFunc(match func(string) bool) (StructField, bool) {
if t.Kind() != Struct {
- panic("reflect: FieldByNameFunc of non-struct type")
+ panic("reflect: FieldByNameFunc of non-struct type " + t.String())
}
tt := (*structType)(unsafe.Pointer(t))
return tt.FieldByNameFunc(match)
func (t *rtype) In(i int) Type {
if t.Kind() != Func {
- panic("reflect: In of non-func type")
+ panic("reflect: In of non-func type " + t.String())
}
tt := (*funcType)(unsafe.Pointer(t))
return toType(tt.in()[i])
func (t *rtype) Key() Type {
if t.Kind() != Map {
- panic("reflect: Key of non-map type")
+ panic("reflect: Key of non-map type " + t.String())
}
tt := (*mapType)(unsafe.Pointer(t))
return toType(tt.key)
func (t *rtype) Len() int {
if t.Kind() != Array {
- panic("reflect: Len of non-array type")
+ panic("reflect: Len of non-array type " + t.String())
}
tt := (*arrayType)(unsafe.Pointer(t))
return int(tt.len)
func (t *rtype) NumField() int {
if t.Kind() != Struct {
- panic("reflect: NumField of non-struct type")
+ panic("reflect: NumField of non-struct type " + t.String())
}
tt := (*structType)(unsafe.Pointer(t))
return len(tt.fields)
func (t *rtype) NumIn() int {
if t.Kind() != Func {
- panic("reflect: NumIn of non-func type")
+ panic("reflect: NumIn of non-func type " + t.String())
}
tt := (*funcType)(unsafe.Pointer(t))
return int(tt.inCount)
func (t *rtype) NumOut() int {
if t.Kind() != Func {
- panic("reflect: NumOut of non-func type")
+ panic("reflect: NumOut of non-func type " + t.String())
}
tt := (*funcType)(unsafe.Pointer(t))
return len(tt.out())
func (t *rtype) Out(i int) Type {
if t.Kind() != Func {
- panic("reflect: Out of non-func type")
+ panic("reflect: Out of non-func type " + t.String())
}
tt := (*funcType)(unsafe.Pointer(t))
return toType(tt.out()[i])
// the name for possible debugging use.
func funcLayout(t *funcType, rcvr *rtype) (frametype *rtype, argSize, retOffset uintptr, stk *bitVector, framePool *sync.Pool) {
if t.Kind() != Func {
- panic("reflect: funcLayout of non-func type")
+ panic("reflect: funcLayout of non-func type " + t.String())
}
if rcvr != nil && rcvr.Kind() == Interface {
panic("reflect: funcLayout with interface receiver " + rcvr.String())