From bb4145c446bdb771fe8c2ddd4a06c8834a065c46 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Tue, 10 Sep 2024 10:01:32 +1200 Subject: [PATCH] Fix incorrect type asssertion in real_operate (#704) --- src/real_operate.jl | 2 +- test/test_utilities.jl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/real_operate.jl b/src/real_operate.jl index 91c5bd21d..7a0ab3a43 100644 --- a/src/real_operate.jl +++ b/src/real_operate.jl @@ -220,7 +220,7 @@ function real_operate( args::AllAllowedReal{T}..., ) where {T<:Real} all_args = (arg1, arg2, arg3, args...) - return foldl((a, b) -> real_operate(vcat, T, a, b), all_args)::SparseTape{T} + return foldl((a, b) -> real_operate(vcat, T, a, b), all_args) end function real_operate( diff --git a/test/test_utilities.jl b/test/test_utilities.jl index 90eae3add..a9b4e12ea 100644 --- a/test/test_utilities.jl +++ b/test/test_utilities.jl @@ -1428,6 +1428,13 @@ function test_not_dcp_warn() return end +function test_real_operate_vector() + x = BigFloat[0] + y = Convex.real_operate(vcat, BigFloat, x, x, x, x, x) + @test y == BigFloat[0, 0, 0, 0, 0] + return +end + end # TestUtilities TestUtilities.runtests()