File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ get_unit(x::SciMLBase.NullParameters) = unitless
7777get_unit (op:: typeof (instream), args) = get_unit (args[1 ])
7878
7979function get_unit (op, args) # Fallback
80- result = oneunit ( op (get_unit .(args)... ) )
80+ result = op (get_unit .(args)... )
8181 try
8282 get_unit (result)
8383 catch
Original file line number Diff line number Diff line change @@ -240,3 +240,10 @@ sys = complete(sys)
240240@test isequal (ModelingToolkit. getdefault (sys. pt. a), sys. v * sys. τ)
241241@test ModelingToolkit. getdefault (sys. v) ≈ 2.0
242242@test ModelingToolkit. getdefault (sys. τ) ≈ 3.0
243+
244+ @testset " Issue#3017" begin
245+ @constants c = 1 [unit = us " mol/nmol" ]
246+ @variables k (t) [unit = us " mol/nmol" ]
247+ @test ModelingToolkit. get_unit (c) == ModelingToolkit. get_unit (- c)
248+ @test_nowarn NonlinearSystem ([k ~ c], [k], []; name= :example )
249+ end
You can’t perform that action at this time.
0 commit comments