Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/systems/nonlinear/initializesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ promote_type_with_nothing(::Type{T}, ::SizedVector{0}) where {T} = T
function promote_type_with_nothing(::Type{T}, ::AbstractArray{T2}) where {T, T2}
promote_type(T, T2)
end
function promote_type_with_nothing(::Type{T}, p::MTKParameters) where {T}
promote_type_with_nothing(promote_type_with_nothing(T, p.tunable), p.initials)
end

promote_with_nothing(::Type, ::Nothing) = nothing
promote_with_nothing(::Type, x::SizedVector{0}) = x
Expand All @@ -628,8 +631,7 @@ end
function promote_u0_p(u0, p, t0)
T = Union{}
T = promote_type_with_nothing(T, u0)
T = promote_type_with_nothing(T, p.tunable)
T = promote_type_with_nothing(T, p.initials)
T = promote_type_with_nothing(T, p)

u0 = promote_with_nothing(T, u0)
p = promote_with_nothing(T, p)
Expand Down
Loading