Skip to content

Commit

Permalink
Deprecate ^(x, p::Integer)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamed2 authored and JeffBezanson committed Feb 6, 2018
1 parent 251a501 commit 46110b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,9 @@ Deprecated or removed
* `DateTime()`, `Date()`, and `Time()` have been deprecated, instead use `DateTime(1)`, `Date(1)`
and `Time(0)` respectively ([#23724]).

* The fallback method `^(x, p::Integer)` is deprecated. If your type relied on this definition,
add a method such as `^(x::MyType, p::Integer) = Base.power_by_squaring(x, p)` ([#23332]).

Command-line option changes
---------------------------

Expand Down
2 changes: 2 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,8 @@ end
@deprecate IOBuffer(read::Bool, write::Bool) IOBuffer(read=read, write=write)
@deprecate IOBuffer(maxsize::Integer) IOBuffer(read=true, write=true, maxsize=maxsize)

# PR #23332
@deprecate ^(x, p::Integer) power_by_squaring(x,p)

# END 0.7 deprecations

Expand Down
1 change: 0 additions & 1 deletion base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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.
Expand Down

0 comments on commit 46110b0

Please sign in to comment.