From c3967af8e9de0088c9a1e6894e82085431e51fe6 Mon Sep 17 00:00:00 2001 From: Eric Davies Date: Fri, 18 Aug 2017 14:20:22 -0500 Subject: [PATCH] Deprecate ^(x, p::Integer) --- base/deprecated.jl | 2 ++ base/intfuncs.jl | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index aff647f193df4e..586d1fb3e6c1ca 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1687,6 +1687,8 @@ end # issue #5148, PR #23259 # warning for `const` on locals should be changed to an error in julia-syntax.scm +@deprecate ^(x, p::Integer) power_by_squaring(x,p) + # END 0.7 deprecations # BEGIN 1.0 deprecations diff --git a/base/intfuncs.jl b/base/intfuncs.jl index da4fa67d9f22a7..997d937594f0cc 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -202,7 +202,6 @@ end ^(x::T, p::T) where {T<:Integer} = power_by_squaring(x,p) ^(x::Number, p::Integer) = power_by_squaring(x,p) -^(x, p::Integer) = power_by_squaring(x,p) # x^p for any literal integer p is lowered to Base.literal_pow(^, x, Val(p)) # to enable compile-time optimizations specialized to p.