Skip to content

Commit f4d497d

Browse files
committed
handle method ambiguity ss/tf
1 parent d9736a4 commit f4d497d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/ControlSystemsBase/src/connections.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ function /(sys1::Union{StateSpace,AbstractStateSpace}, sys2::LTISystem)
215215
sys1new, sys2new = promote(sys1, 1/sys2)
216216
return sys1new*sys2new
217217
end
218+
function /(sys1::Union{StateSpace,AbstractStateSpace}, sys2::TransferFunction) # This method is handling ambiguity between method above and one with explicit TF as second argument, hit by ss(1)/tf(1)
219+
sys1new, sys2new = promote(sys1, 1/sys2)
220+
return sys1new*sys2new
221+
end
218222

219223
@static if VERSION >= v"1.8.0-beta1"
220224
blockdiag(anything...) = cat(anything..., dims=Val((1,2)))

lib/ControlSystemsBase/test/test_connections.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,6 @@ Pr = input_resolvent(P)
438438
@test Pr.C == I
439439
@test iszero(Pr.D)
440440

441+
@test ss(1) / tf(1) == ss(1) # Test no method ambiguity
442+
441443
end

0 commit comments

Comments
 (0)