Skip to content

Commit 8a91ab7

Browse files
committed
Change default Metadata value type to Any
1 parent 7aae613 commit 8a91ab7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/varinfo.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct Metadata{
3737
TIdcs<:Dict{<:VarName,Int},
3838
TDists<:AbstractVector{<:Distribution},
3939
TVN<:AbstractVector{<:VarName},
40-
TVal<:AbstractVector{<:Real},
40+
TVal<:AbstractVector{<:Any},
4141
}
4242
# Mapping from the `VarName` to its integer index in `vns`, `ranges` and `dists`
4343
idcs::TIdcs # Dict{<:VarName,Int}
@@ -51,7 +51,7 @@ struct Metadata{
5151

5252
# Vector of values of all the univariate, multivariate and matrix variables
5353
# The value(s) of `vn` is/are `vals[ranges[idcs[vn]]]`
54-
vals::TVal # AbstractVector{<:Real}
54+
vals::TVal # AbstractVector{<:Any}
5555

5656
# Vector of distributions correpsonding to `vns`
5757
dists::TDists # AbstractVector{<:Distribution}
@@ -409,7 +409,7 @@ unflatten_metadata(vnv::VarNamedVector, x::AbstractVector) = unflatten(vnv, x)
409409
Construct an empty type unstable instance of `Metadata`.
410410
"""
411411
function Metadata()
412-
vals = Vector{Real}()
412+
vals = Vector{Any}()
413413
flags = Dict{String,BitVector}()
414414
flags["del"] = BitVector()
415415
flags["trans"] = BitVector()
@@ -576,8 +576,8 @@ function merge_metadata(metadata_left::Metadata, metadata_right::Metadata)
576576
T_right = eltype(metadata_right.vals)
577577
T = promote_type(T_left, T_right)
578578
# TODO: Is this necessary?
579-
if !(T <: Real)
580-
T = Real
579+
if !(T <: Any)
580+
T = Any
581581
end
582582

583583
# Determine `eltype` of `dists`.
@@ -767,7 +767,7 @@ function getindex_internal(vi::NTVarInfo, ::Colon)
767767
return reduce(vcat, map(Base.Fix2(getindex_internal, Colon()), vi.metadata))
768768
end
769769
function getindex_internal(vi::VarInfo{NamedTuple{(),Tuple{}}}, ::Colon)
770-
return float(Real)[]
770+
return Any[]
771771
end
772772
function getindex_internal(md::Metadata, ::Colon)
773773
return mapreduce(

0 commit comments

Comments
 (0)