From 4b55cf8516e5a72fb9fa085dc733494ed8159d1d Mon Sep 17 00:00:00 2001 From: tan Date: Mon, 23 Nov 2020 08:31:41 +0530 Subject: [PATCH] add hasproperty for Julia < 1.2 compat ProtoBuf uses Base.hasproperty, however this was introduced in Julia 1.2. This adds `hasproperty` for Julia versions < 1.2. fixes #147 --- Project.toml | 2 +- src/ProtoBuf.jl | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index cdbe900..d861aea 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "3349acd9-ac6a-5e09-bcdb-63829b23a429" keywords = ["protobuf", "protoc"] license = "MIT" desc = "Julia protobuf implementation" -version = "0.9.0" +version = "0.9.1" [deps] Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" diff --git a/src/ProtoBuf.jl b/src/ProtoBuf.jl index 5fab7d5..4b8cfd0 100644 --- a/src/ProtoBuf.jl +++ b/src/ProtoBuf.jl @@ -1,6 +1,12 @@ module ProtoBuf -import Base: setproperty!, getproperty, hasproperty, propertynames, show, copy!, deepcopy, hash, isequal, == +import Base: setproperty!, getproperty, propertynames, show, copy!, deepcopy, hash, isequal, == + +if VERSION < v"1.2.0-DEV.272" + hasproperty(x, s::Symbol) = s in propertynames(x) +else + import Base: hasproperty +end export writeproto, readproto, ProtoMeta, ProtoMetaAttribs, meta export isfilled, which_oneof