13 func (type2 *safeType) New() interface{} {
14 return reflect.New(type2.Type).Interface()
17 func (type2 *safeType) UnsafeNew() unsafe.Pointer {
18 panic("does not support unsafe operation")
21 func (type2 *safeType) Elem() Type {
22 return type2.cfg.Type2(type2.Type.Elem())
25 func (type2 *safeType) Type1() reflect.Type {
29 func (type2 *safeType) PackEFace(ptr unsafe.Pointer) interface{} {
30 panic("does not support unsafe operation")
33 func (type2 *safeType) Implements(thatType Type) bool {
34 return type2.Type.Implements(thatType.Type1())
37 func (type2 *safeType) RType() uintptr {
38 panic("does not support unsafe operation")
41 func (type2 *safeType) Indirect(obj interface{}) interface{} {
42 return reflect.Indirect(reflect.ValueOf(obj)).Interface()
45 func (type2 *safeType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
46 panic("does not support unsafe operation")
49 func (type2 *safeType) LikePtr() bool {
50 panic("does not support unsafe operation")
53 func (type2 *safeType) IsNullable() bool {
54 return IsNullable(type2.Kind())
57 func (type2 *safeType) IsNil(obj interface{}) bool {
61 return reflect.ValueOf(obj).Elem().IsNil()
64 func (type2 *safeType) UnsafeIsNil(ptr unsafe.Pointer) bool {
65 panic("does not support unsafe operation")
68 func (type2 *safeType) Set(obj interface{}, val interface{}) {
69 reflect.ValueOf(obj).Elem().Set(reflect.ValueOf(val).Elem())
72 func (type2 *safeType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) {
73 panic("does not support unsafe operation")
76 func (type2 *safeType) AssignableTo(anotherType Type) bool {
77 return type2.Type1().AssignableTo(anotherType.Type1())