I've been working on understanding some macro code I inherited, which (I
believe) essentially does this:
type VegaAxis2
_type::Union{AbstractString, Void} = "x"
scale::Union{AbstractString, Void} = "x"
orient::Union{AbstractString, Void} = nothing
title::Union{AbstractString, Void} = nothing
titleOffset::Union{Number, Void} = nothing
format::Union{AbstractString, Void} = nothing
ticks::Union{Number, Void} = nothing
values::Union{Vector, Void} = nothing
subdivide::Union{Number, Void} = nothing
tickPadding::Union{Number, Void} = nothing
tickSize::Union{Number, Void} = nothing
tickSizeMajor::Union{Number, Void} = nothing
tickSizeMinor::Union{Number, Void} = nothing
tickSizeEnd::Union{Number, Void} = nothing
offset::Union{Number, Dict{Any, Any}, Void} = nothing
layer::Union{AbstractString, Void} = nothing
grid::Union{Bool, Void} = nothing
properties::Union{Dict{Any,Any}, Void} = nothing
end
Running the code above verbatim gives the following error:
LoadError: syntax: "_type::Union{AbstractString,Void}=x" inside type definition
is reserved
while loading In[87], in expression starting on line 20
I believe macro itself is simulating this behavior by writing out the following
and time VegaAxis2() is called:
VegaAxis2("x","x",nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing)
Long story short, why is the assignment behavior inside Composite Types
reserved? Is this always going to be the behavior, or will this restriction be
removed in the future, so that you can assign default values?