Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match base julia error messages for hvcat #588

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,15 @@
if anysparse(X1) || anysparse(X...)
vcat(_hvcat_rows(rows, X1, X...)...)
else
# Needed to match error type with Base Julia. See https://github.com/JuliaLang/julia/pull/56543#issuecomment-2508637550
matrix_len = if length(rows) == 0
0

Check warning on line 1248 in src/sparsevector.jl

View check run for this annotation

Codecov / codecov/patch

src/sparsevector.jl#L1248

Added line #L1248 was not covered by tests
else
length(rows) * rows[1]
end
if matrix_len != 1 + length(X)
throw(ArgumentError("argument count does not match specified shape (expected $matrix_len, got $(1+length(X)))"))

Check warning on line 1253 in src/sparsevector.jl

View check run for this annotation

Codecov / codecov/patch

src/sparsevector.jl#L1253

Added line #L1253 was not covered by tests
end
Base.typed_hvcat(Base.promote_eltypeof(X1, X...), rows, X1, X...)
end
end
Expand Down
Loading