Skip to content

Constructor for generators #28

@kahaaga

Description

@kahaaga

It would be nice if the following worked:

julia> StateSpaceSet(rand(SVector{5, Float64}) for i = 1:1000)
ERROR: MethodError: no method matching StateSpaceSet(::Base.Generator{UnitRange{Int64}, var"#3#4"})
The type `StateSpaceSet` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  StateSpaceSet(::Vector{<:Real}, ::AbstractStateSpaceSet{D, T}) where {D, T}
   @ StateSpaceSets ~/.julia/packages/StateSpaceSets/uC924/src/statespaceset_concrete.jl:93
  StateSpaceSet(::Array{SVector{D, T}, 1}) where {D, T}
   @ StateSpaceSets ~/.julia/packages/StateSpaceSets/uC924/src/statespaceset_concrete.jl:43
  StateSpaceSet(::Vector{<:AbstractArray{T}}) where T<:Number
   @ StateSpaceSets ~/.julia/packages/StateSpaceSets/uC924/src/statespaceset_concrete.jl:57
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[14]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions