Skip to content

Instantly share code, notes, and snippets.

@malmaud
Created February 2, 2017 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malmaud/41e922caed12cce92a3ce3fdfb3b9eb5 to your computer and use it in GitHub Desktop.
Save malmaud/41e922caed12cce92a3ce3fdfb3b9eb5 to your computer and use it in GitHub Desktop.
protobuf bug
syntax="proto3";
message Hi {
repeated int32 x = 1 [packed=true];
}
# syntax: proto3
using Compat
using ProtoBuf
import ProtoBuf.meta
import Base: hash, isequal, ==
type Hi
x::Array{Int32,1}
Hi(; kwargs...) = (o=new(); fillunset(o); isempty(kwargs) || ProtoBuf._protobuild(o, kwargs); o)
end #type Hi
const __pack_Hi = Symbol[:x]
meta(t::Type{Hi}) = meta(t, ProtoBuf.DEF_REQ, ProtoBuf.DEF_FNUM, ProtoBuf.DEF_VAL, true, __pack_Hi, ProtoBuf.DEF_WTYPES, ProtoBuf.DEF_ONEOFS, ProtoBuf.DEF_ONEOF_NAMES)
hash(v::Hi) = ProtoBuf.protohash(v)
isequal(v1::Hi, v2::Hi) = ProtoBuf.protoisequal(v1, v2)
==(v1::Hi, v2::Hi) = ProtoBuf.protoeq(v1, v2)
export Hi
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hi.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='hi.proto',
package='',
syntax='proto3',
serialized_pb=_b('\n\x08hi.proto\"\x13\n\x02Hi\x12\r\n\x01x\x18\x01 \x03(\x05\x42\x02\x10\x01\x62\x06proto3')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_HI = _descriptor.Descriptor(
name='Hi',
full_name='Hi',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='x', full_name='Hi.x', index=0,
number=1, type=5, cpp_type=1, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\020\001'))),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=12,
serialized_end=31,
)
DESCRIPTOR.message_types_by_name['Hi'] = _HI
Hi = _reflection.GeneratedProtocolMessageType('Hi', (_message.Message,), dict(
DESCRIPTOR = _HI,
__module__ = 'hi_pb2'
# @@protoc_insertion_point(class_scope:Hi)
))
_sym_db.RegisterMessage(Hi)
_HI.fields_by_name['x'].has_options = True
_HI.fields_by_name['x']._options = _descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\020\001'))
# @@protoc_insertion_point(module_scope)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment