Skip to content

Commit 8547ddb

Browse files
authored
Extend to_power_type only if it is defined (#374)
Fix #373
1 parent 5ab3edd commit 8547ddb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/LazyArrays.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ include("lazysetoperations.jl")
5858
include("lazyoperations.jl")
5959
include("lazymacro.jl")
6060

61-
# support x^2
62-
Base.to_power_type(x::LazyArray) = x
61+
if isdefined(Base, :to_power_type)
62+
# Gone in Julia 1.12-rc1
63+
# support x^2
64+
Base.to_power_type(x::LazyArray) = x
65+
end
6366

6467
# Special broadcasting for BlockArrays.jl
6568
map(::typeof(length), A::BroadcastVector{OneTo{Int},Type{OneTo}}) = A.args[1]

0 commit comments

Comments
 (0)