From 64843e51123a7cb48dfb4dd0b9a1b95e93d0f1bd Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 27 Aug 2026 12:29:37 +0100 Subject: [PATCH] don't promote when types compatible for StaticUnitBall --- src/domains/ball.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/domains/ball.jl b/src/domains/ball.jl index 5f248c2..3b99f4d 100644 --- a/src/domains/ball.jl +++ b/src/domains/ball.jl @@ -178,6 +178,10 @@ StaticUnitBall{T,C}(dim::Int) where {T,C} = StaticUnitBall{T,C}(::Val{N}) where {N,T,C} = (@assert N == euclideandimension(T); StaticUnitBall{T,C}()) +# don't change the type +promote_pair(x::T, d::StaticUnitBall{T}) where {T<:StaticVector} = x,d + + "The unit ball in a fixed N-dimensional space." const EuclideanUnitBall{N,T,C} = StaticUnitBall{SVector{N,T},C}