Skip to content

Commit 5f07c99

Browse files
committed
error rather than segfault by accidentally bypassing outer ctors
1 parent 101f875 commit 5f07c99

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/matrix.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ function GBMatrix(v::GBVector)
6565
return copy(GBMatrix{eltype(v), typeof(v.fill)}(v.p, v.fill))
6666
end
6767

68+
GBMatrix{T, F}(::Number, ::Number) where {T, F} = throw(ArgumentError("The F parameter is implicit and determined by the `fill` keyword argument to constructors. Users must not specify this manually."))
69+
6870
# Some Base and basic SparseArrays/LinearAlgebra functions:
6971
###########################################################
7072

src/vector.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ function GBVector(n::Integer, x::T; fill = nothing) where {T}
5959
return v
6060
end
6161

62+
GBVector{T, F}(::Number) where {T, F} = throw(ArgumentError("The F parameter is implicit and determined by the `fill` keyword argument to constructors. Users must not specify this manually."))
63+
64+
6265
# Some Base and basic SparseArrays/LinearAlgebra functions:
6366
###########################################################
6467
Base.unsafe_convert(::Type{LibGraphBLAS.GrB_Matrix}, v::GBVector) = v.p[]

0 commit comments

Comments
 (0)