Skip to content

Commit 0db98b4

Browse files
authored
Add return type annotation for Julia handling of OneOf (#215)
1 parent db90027 commit 0db98b4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sdks/julia/LogicalQueryProtocol.jl/src/protobuf-helpers.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ function _get_oneof_field(obj, field_sym::Symbol)
2525
for fname in fieldnames(typeof(obj))
2626
fval = getfield(obj, fname)
2727
if fval isa ProtoBuf.OneOf && fval.name == field_sym
28-
return fval[]
28+
typ = ProtoBuf.oneof_field_types(typeof(obj))[fname][field_sym]
29+
return fval[]::typ
2930
end
3031
end
3132
error("No oneof field $field_sym on $(typeof(obj))")

0 commit comments

Comments
 (0)