diff --git a/src/MVector.jl b/src/MVector.jl index a5e1e10f..3fae1a07 100644 --- a/src/MVector.jl +++ b/src/MVector.jl @@ -18,8 +18,10 @@ end let dimension_names = QuoteNode.([:x, :y, :z, :w]) body = :(getfield(v, name)) for (i,dim_name) in enumerate(dimension_names) - @eval @inline Base.propertynames(v::Union{SVector{$i},MVector{$i}}, private::Bool = false) = - private ? ($(first(dimension_names, i)...), :data) : ($(first(dimension_names, i)...),) + @eval @inline function Base.propertynames(v::Union{SVector{$i},MVector{$i}}, private::Bool = false) + named_dims = $(first(dimension_names, i)...) + private ? (named_dims..., :data) : named_dims + end body = :(name === $(dimension_names[i]) ? getfield(v, :data)[$i] : $body) @eval @inline function Base.getproperty(v::Union{SVector{$i},MVector{$i}},