Skip to content

Commit

Permalink
make signatures for Box more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
arturgower committed Aug 9, 2023
1 parent ed79487 commit 753b962
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shapes/box.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct Box{T,Dim} <: Shape{Dim}
dimensions::SVector{Dim,T}
end

function Box(origin::AbstractVector{T}, dimensions::AbstractVector{T}) where T
function Box(origin::AbstractVector{T}, dimensions::AbstractVector{T}) where T <: AbstractFloat
Dim = length(origin)
Box{T,Dim}(origin, dimensions)
end
Expand All @@ -17,7 +17,7 @@ function Box(origin::NTuple{Dim,T}, dimensions::NTuple{Dim,T}) where {Dim,T}
Box{T,Dim}(origin, dimensions)
end

Box(dimensions::AbstractVector{T}) where T = Box(zeros(T,length(dimensions)),dimensions)
Box(dimensions::AbstractVector{T}) where T <: AbstractFloat = Box(zeros(T,length(dimensions)),dimensions)

"""
Box(points::Vector{v} where v <: AbstractVector)
Expand Down

0 comments on commit 753b962

Please sign in to comment.