Skip to content

Commit 7d3b002

Browse files
Merge pull request #1308 from SciML/ChrisRackauckas-patch-3-1
Fix NullParameter get_unit handling
2 parents 9bf38dd + f51da0e commit 7d3b002

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/systems/validation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ get_unit(x::Literal) = screen_unit(getmetadata(x,VariableUnit, unitless))
4242
get_unit(op::Differential, args) = get_unit(args[1]) / get_unit(op.x)
4343
get_unit(op::Difference, args) = get_unit(args[1]) / get_unit(op.t)
4444
get_unit(op::typeof(getindex),args) = get_unit(args[1])
45-
get_unit(x::typeof(SciMLBase.NullParameters)) = unitless
45+
get_unit(x::SciMLBase.NullParameters) = unitless
4646

4747
function get_unit(op,args) # Fallback
4848
result = op(1 .* get_unit.(args)...)

test/units.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ D = Differential(t)
1616
@test MT.get_unit(τ) == u"ms"
1717
@test MT.get_unit(γ) == MT.unitless
1818
@test MT.get_unit(0.5) == MT.unitless
19-
@test MT.get_unit(MT.SciMLBase.NullParameters) == MT.unitless
19+
@test MT.get_unit(MT.SciMLBase.NullParameters()) == MT.unitless
2020

2121
# Prohibited unit types
2222
@parameters β [unit = u"°"] α [unit = u"°C"] γ [unit = 1u"s"]

0 commit comments

Comments
 (0)