Skip to content

Commit

Permalink
Fix incorrect type asssertion in real_operate (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Sep 9, 2024
1 parent 93c68c6 commit bb4145c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/real_operate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 7 additions & 0 deletions test/test_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit bb4145c

Please sign in to comment.