Skip to content

Commit 2177096

Browse files
committed
Update initialisation.jl
Fix issue when copying an UninitializedVar into the status for getting the type of the variable in pre-allocation of the outputs
1 parent a883289 commit 2177096

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/mtg/initialisation.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ ref_var(v::T) where {T<:AbstractString} = Base.Ref(v) # No copy method for strin
262262
ref_var(v::T) where {T<:Base.RefValue} = v
263263
ref_var(v::T) where {T<:RefVector} = Base.Ref(v)
264264
ref_var(v::T) where {T<:RefVariable} = v
265+
ref_var(v::UninitializedVar) = Base.Ref(copy(v.value))
265266

266267
"""
267268
init_simulation(mtg, mapping; nsteps=1, outputs=nothing, type_promotion=nothing, check=true, verbose=true)

0 commit comments

Comments
 (0)