From a38d47c91ff35c117116e21832d011af14943c1c Mon Sep 17 00:00:00 2001 From: OlivierHnt <38465572+OlivierHnt@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:43:12 +0200 Subject: [PATCH] Fix method ambiguities --- src/intervals/arithmetic/power.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/intervals/arithmetic/power.jl b/src/intervals/arithmetic/power.jl index ac9334d9b..7f94153c1 100644 --- a/src/intervals/arithmetic/power.jl +++ b/src/intervals/arithmetic/power.jl @@ -70,7 +70,9 @@ Base.:^(x::Complex{<:Interval}, y::Complex{<:Interval}) = ^(promote(x, y)...) Base.:^(x::Complex{<:Interval}, y::Real) = ^(promote(x, y)...) Base.:^(x::Real, y::Complex{<:Interval}) = ^(promote(x, y)...) # needed to avoid method ambiguities +Base.:^(x::Complex{<:Interval}, n::Bool) = ^(promote(x, n)...) Base.:^(x::Complex{<:Interval}, n::Integer) = ^(promote(x, n)...) +Base.:^(x::Complex{<:Interval}, n::Rational) = ^(promote(x, n)...) # overwrite behaviour for small integer powers from https://github.com/JuliaLang/julia/pull/24240 # Base.literal_pow(::typeof(^), x::Interval, ::Val{n}) where {n} = x^n