Drvi / ProtocolBuffers.jl

4 stars 0 forks source link

Add `parametrize_oneofs` option to `protojl` #8

Closed Drvi closed 2 years ago

Drvi commented 2 years ago

This is PR is based on #7. As mentioned in the PR description of #7, this allows the user to switch between two different struct parametrizations:

struct A
    oneof_field::Union{Nothing,OneOf{<:Union{Int,String}}}
end
struct B{T1<:Union{Nothing,OneOf{<:Union{Int,String}}}}
   oneof_field::T1
end

By default, the A option would be generated (this is technically a breaking change, but we have 0 users, yay).

codecov[bot] commented 2 years ago

Codecov Report

Merging #8 (f92d438) into master (15f5cf1) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage   89.48%   89.52%   +0.03%     
==========================================
  Files          22       22              
  Lines        2502     2502              
==========================================
+ Hits         2239     2240       +1     
+ Misses        263      262       -1     
Impacted Files Coverage Δ
src/codegen/modules.jl 83.33% <100.00%> (ø)
src/codegen/toplevel_definitions.jl 97.61% <100.00%> (+0.79%) :arrow_up:
src/codegen/types.jl 94.89% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 15f5cf1...f92d438. Read the comment docs.