Skip to content

Commit 42b4b31

Browse files
author
Oscar Smith
authored
AbstractTrees v0.4 compat (#1639)
1 parent 2e00834 commit 42b4b31

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
4444
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
4545

4646
[compat]
47-
AbstractTrees = "0.3"
47+
AbstractTrees = "0.3, 0.4"
4848
ArrayInterfaceCore = "0.1.1"
4949
Combinatorics = "1"
5050
ConstructionBase = "1"

src/systems/abstractsystem.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,12 @@ end
10551055
function AbstractTrees.printnode(io::IO, sys::ModelingToolkit.AbstractSystem)
10561056
print(io, nameof(sys))
10571057
end
1058-
AbstractTrees.nodetype(::ModelingToolkit.AbstractSystem) = ModelingToolkit.AbstractSystem
1058+
function Base.IteratorEltype(::Type{<:TreeIterator{ModelingToolkit.AbstractSystem}})
1059+
Base.HasEltype()
1060+
end
1061+
function Base.eltype(::Type{<:TreeIterator{ModelingToolkit.AbstractSystem}})
1062+
ModelingToolkit.AbstractSystem
1063+
end
10591064

10601065
function check_eqs_u0(eqs, dvs, u0; check_length = true, kwargs...)
10611066
if u0 !== nothing

0 commit comments

Comments
 (0)