Open JonasIsensee opened 5 years ago
From what I see, this is not really an issue with GeometryTypes.jl, but the underlying StaticArrays.jl that is used for the points.
I tracked this down to
@generated function _rand(rng::AbstractRNG, ::Size{s}, ::Type{SA}) where {s, SA <: StaticArray}
T = eltype(SA)
if T == Any
T = Float64
end
v = [:(rand(rng, $T)) for i = 1:prod(s)]
return quote
@_inline_meta
$SA(tuple($(v...)))
end
end
which is in arraymath.jl
of StaticArrays.
Though I don't really think this is even a real defect there, because as result it gives you an Array that you can still push more static arrays with other inner types to, and when you really want just Float64, you can still give it explicitly.
I noticed the following unfortunate behaviour.
Point2
does not specify it's precision but defaults to Float64. However when callingrand(Point2, 2)
we receive an array that is not concretely typed.