Skip to content

Commit 89c7f70

Browse files
committed
Change default Metadata value type to Any
1 parent ce7c8b1 commit 89c7f70

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
@@ -38,7 +38,7 @@ struct Metadata{
3838
TIdcs<:Dict{<:VarName,Int},
3939
TDists<:AbstractVector{<:Distribution},
4040
TVN<:AbstractVector{<:VarName},
41-
TVal<:AbstractVector{<:Real},
41+
TVal<:AbstractVector{<:Any},
4242
}
4343
# Mapping from the `VarName` to its integer index in `vns`, `ranges` and `dists`
4444
idcs::TIdcs # Dict{<:VarName,Int}
@@ -52,7 +52,7 @@ struct Metadata{
5252

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

5757
# Vector of distributions correpsonding to `vns`
5858
dists::TDists # AbstractVector{<:Distribution}
@@ -483,7 +483,7 @@ unflatten_metadata(vnv::VarNamedVector, x::AbstractVector) = unflatten(vnv, x)
483483
Construct an empty type unstable instance of `Metadata`.
484484
"""
485485
function Metadata()
486-
vals = Vector{Real}()
486+
vals = Vector{Any}()
487487
flags = Dict{String,BitVector}()
488488
flags["del"] = BitVector()
489489
flags["trans"] = BitVector()
@@ -662,8 +662,8 @@ function merge_metadata(metadata_left::Metadata, metadata_right::Metadata)
662662
T_right = eltype(metadata_right.vals)
663663
T = promote_type(T_left, T_right)
664664
# TODO: Is this necessary?
665-
if !(T <: Real)
666-
T = Real
665+
if !(T <: Any)
666+
T = Any
667667
end
668668

669669
# Determine `eltype` of `dists`.
@@ -855,7 +855,7 @@ function getindex_internal(vi::NTVarInfo, ::Colon)
855855
return reduce(vcat, map(Base.Fix2(getindex_internal, Colon()), vi.metadata))
856856
end
857857
function getindex_internal(vi::VarInfo{NamedTuple{(),Tuple{}}}, ::Colon)
858-
return float(Real)[]
858+
return Any[]
859859
end
860860
function getindex_internal(md::Metadata, ::Colon)
861861
return mapreduce(

0 commit comments

Comments
 (0)