Skip to content

Commit c0239a3

Browse files
committed
Drop compat code for CartesianRange in at-compat from #377
1 parent 072b0f7 commit c0239a3

File tree

4 files changed

+6
-27
lines changed

4 files changed

+6
-27
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ Please check the list below for the specific syntax you need.
4343

4444
Currently, the `@compat` macro supports the following syntaxes:
4545

46-
* `@compat foo(::CartesianRange{N})` to replace the former
47-
`foo(::CartesianRange{CartesianIndex{N}})` ([#20974]). Note that
48-
`CartesianRange` now has two type parameters, so using them as
49-
fields in other `struct`s requires manual intervention.
50-
5146
## Module Aliases
5247

5348
## New functions, macros, and methods

src/compatmacro.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ function _compat(ex::Expr)
1111
# Passthrough
1212
return ex
1313
end
14-
if VERSION < v"0.7.0-DEV.880"
15-
if ex.head == :curly && ex.args[1] == :CartesianRange && length(ex.args) >= 2
16-
a = ex.args[2]
17-
if a != :CartesianIndex && !(isa(a, Expr) && a.head == :curly && a.args[1] == :CartesianIndex)
18-
return Expr(:curly, :CartesianRange, Expr(:curly, :CartesianIndex, ex.args[2]))
19-
end
20-
end
21-
end
2214
if VERSION < v"0.7.0-DEV.2562"
2315
if ex.head == :call && ex.args[1] == :finalizer
2416
ex.args[2], ex.args[3] = ex.args[3], ex.args[2]

test/old.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,3 +1295,9 @@ let
12951295
@test func5(y=3, x=2) == 6
12961296
@test_throws UndefKeywordError func5(x=2)
12971297
end
1298+
1299+
let
1300+
@compat cr(::CartesianIndices{2}) = 2
1301+
@test cr(CartesianIndices((5, 3))) == 2
1302+
@test_throws MethodError cr(CartesianIndices((5, 3, 2)))
1303+
end

test/runtests.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ for x in (3.1, -17, 3//4, big(111.1), Inf)
5555
@test minmax(x) == (x, x)
5656
end
5757

58-
let
59-
@compat cr(::CartesianIndices{2}) = 2
60-
@test cr(CartesianIndices((5, 3))) == 2
61-
@test_throws MethodError cr(CartesianIndices((5, 3, 2)))
62-
end
63-
if VERSION < v"0.7.0-DEV.880"
64-
# ensure we don't bork any non-updated expressions
65-
let
66-
@compat cr(::CartesianRange{CartesianIndex{2}}) = 2
67-
@test cr(CartesianRange((5, 3))) == 2
68-
@test_throws MethodError cr(CartesianRange((5, 3, 2)))
69-
end
70-
end
71-
7258
# 0.7
7359
let A = [1]
7460
local x = 0

0 commit comments

Comments
 (0)