From 308a8d857ceb0bb45181d011d9183e3b44cc384a Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Fri, 29 Dec 2017 14:34:34 -0800 Subject: [PATCH] Don't export axes --- README.md | 3 ++- src/Compat.jl | 3 ++- test/runtests.jl | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c491841e1..a6646614c 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,8 @@ Currently, the `@compat` macro supports the following syntaxes: * `Associative` is now `AbstractDict` ([#25012]). -* `indices` is now `axes` ([#25057]). +* `indices` is now `axes` ([#25057]). This function is not exported from Compat to avoid + conflicts with AxisArrays and other such packages. * `Void` is now `Nothing` with an alias `Cvoid` for C interop ([#25162]). diff --git a/src/Compat.jl b/src/Compat.jl index e0fcd68f5..7317bf70a 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -999,7 +999,8 @@ end # 0.7.0-DEV.2978 @static if !isdefined(Base, :axes) const axes = Base.indices - export axes + # NOTE: Intentionally not exported to avoid conflicts with AxisArrays + #export axes end # 0.7.0-DEV.3137 diff --git a/test/runtests.jl b/test/runtests.jl index 70a2ebcf8..e88d28e71 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1043,9 +1043,9 @@ end @test AbstractDict === (isdefined(Base, :AbstractDict) ? Base.AbstractDict : Base.Associative) # 0.7.0-DEV.2978 -@test axes === (isdefined(Base, :axes) ? Base.axes : Base.indices) -@test axes(1) == () -@test axes(1,1) == 1:1 +@test Compat.axes === (isdefined(Base, :axes) ? Base.axes : Base.indices) +@test Compat.axes(1) == () +@test Compat.axes(1,1) == 1:1 # 0.7.0-DEV.3137 @test Nothing === (isdefined(Base, :Nothing) ? Base.Nothing : Base.Void)