func (cdc *Codec) newTypeInfoUnregistered(rt reflect.Type) *TypeInfo {
	if rt.Kind() == reflect.Ptr {
		panic("unexpected pointer type") // should not happen.
	}
	if rt.Kind() == reflect.Interface {
		panic("unexpected interface type") // should not happen.
	}

	var info = new(TypeInfo)
	info.Type = rt
	info.PtrToType = reflect.PtrTo(rt)
	info.ZeroValue = reflect.Zero(rt)
	info.ZeroProto = reflect.Zero(rt).Interface()
	if rt.Kind() == reflect.Struct {
		info.StructInfo = cdc.parseStructInfo(rt)
	}
	if rm, ok := rt.MethodByName("MarshalAmino"); ok {
		info.ConcreteInfo.IsAminoMarshaler = true
		info.ConcreteInfo.AminoMarshalReprType = marshalAminoReprType(rm)
	}
	if rm, ok := reflect.PtrTo(rt).MethodByName("UnmarshalAmino"); ok {
		info.ConcreteInfo.IsAminoUnmarshaler = true
		info.ConcreteInfo.AminoUnmarshalReprType = unmarshalAminoReprType(rm)
	}
	return info
}
func (cdc *Codec) newTypeInfoUnregistered(rt reflect.Type) *TypeInfo {
	if rt.Kind() == reflect.Ptr {
		panic("unexpected pointer type") 
	}
	if rt.Kind() == reflect.Interface {
		panic("unexpected interface type") 
	}

	var info = new(TypeInfo)
	info.Type = rt
	info.PtrToType = reflect.PtrTo(rt)
	info.ZeroValue = reflect.Zero(rt)
	info.ZeroProto = reflect.Zero(rt).Interface()
	if rt.Kind() == reflect.Struct {
		info.StructInfo = cdc.parseStructInfo(rt)
	}
	if rm, ok := rt.MethodByName("MarshalAmino"); ok {
		info.ConcreteInfo.IsAminoMarshaler = true
		info.ConcreteInfo.AminoMarshalReprType = marshalAminoReprType(rm)
	}
	if rm, ok := reflect.PtrTo(rt).MethodByName("UnmarshalAmino"); ok {
		info.ConcreteInfo.IsAminoUnmarshaler = true
		info.ConcreteInfo.AminoUnmarshalReprType = unmarshalAminoReprType(rm)
	}
	return info
}
func ( cdc * Codec ) newTypeInfoUnregistered ( rt reflect . Type ) * TypeInfo { if rt . Kind ( ) == reflect . Ptr { panic ( " " ) // should not happen. } if rt . Kind ( ) == reflect . Interface { panic ( " " ) // should not happen. } var info = new ( TypeInfo ) info . Type = rt info . PtrToType = reflect . PtrTo ( rt ) info . ZeroValue = reflect . Zero ( rt ) info . ZeroProto = reflect . Zero ( rt ) . Interface ( ) if rt . Kind ( ) == reflect . Struct { info . StructInfo = cdc . parseStructInfo ( rt ) } if rm , ok := rt . MethodByName ( " " ) ; ok { info . ConcreteInfo . IsAminoMarshaler = true info . ConcreteInfo . AminoMarshalReprType = marshalAminoReprType ( rm ) } if rm , ok := reflect . PtrTo ( rt ) . MethodByName ( " " ) ; ok { info . ConcreteInfo . IsAminoUnmarshaler = true info . ConcreteInfo . AminoUnmarshalReprType = unmarshalAminoReprType ( rm ) } return info }
// Constructs a *TypeInfo automatically, not from registration.
Constructs a * TypeInfo automatically not from registration .