Skip to content

Commit c08650f

Browse files
authored
Merge pull request #56 from julia-vscode/sp/lower-fieldless
allow fieldless outbound types
2 parents 38f3174 + 5849b2e commit c08650f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/interface_def.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ function JSON.Writer.CompositeTypeWrapper(t::Outbound)
1313
JSON.Writer.CompositeTypeWrapper(t, Tuple(fns))
1414
end
1515

16+
function JSON.lower(a::Outbound)
17+
if nfields(a) > 0
18+
JSON.Writer.CompositeTypeWrapper(a)
19+
else
20+
nothing
21+
end
22+
end
23+
1624
function field_allows_missing(field::Expr)
1725
field.head == :(::) && field.args[2] isa Expr &&
1826
field.args[2].head == :curly && field.args[2].args[1] == :Union &&

0 commit comments

Comments
 (0)