Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

rand(Point2, 10) gives non-concrete type #176

Description

@JonasIsensee

I noticed the following unfortunate behaviour.
Point2 does not specify it's precision but defaults to Float64.
However when calling rand(Point2, 2) we receive an array that is not concretely typed.

julia> rand(Point2f0, 2)
2-element Array{Point{2,Float32},1}:
 [0.258088, 0.584784]
 [0.374788, 0.938358]

julia> rand(Point2, 2)
2-element Array{Point{2,T} where T,1}:
 [0.860157, 0.0883986]
 [0.595633, 0.42712]  

julia> rand(Point2)
2-element Point{2,Float64}:
 0.5607439716284568 
 0.29493527430930033

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions