Skip to content

Commit

Permalink
Remove at-compat for type aliases
Browse files Browse the repository at this point in the history
Was added in #326, now obsolete as no longer required on minimum
supported Julia version 0.6.
  • Loading branch information
martinholters committed Aug 27, 2018
1 parent 0fef5d3 commit 3947c62
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ Currently, the `@compat` macro supports the following syntaxes:
to declare abstract and primitive types. [#20418]
This only works when `@compat` is applied directly on the declaration.

* `@compat A{T} = B{T}` or `@compat const A{T} = B{T}` to declare type alias with free
parameters. [#20500]. Use `const A = B{T}` or `const A = B` for type alias without free parameters (i.e. no type parameter on the left hand side).

* `@compat Base.IndexStyle(::Type{<:MyArray}) = IndexLinear()` and `@compat Base.IndexStyle(::Type{<:MyArray}) = IndexCartesian()` to define traits for abstract arrays, replacing the former `Base.linearindexing{T<:MyArray}(::Type{T}) = Base.LinearFast()` and `Base.linearindexing{T<:MyArray}(::Type{T}) = Base.LinearSlow()`, respectively.

* `Compat.collect(A)` returns an `Array`, no matter what indices the array `A` has. [#21257]
Expand Down Expand Up @@ -550,7 +547,6 @@ includes this fix. Find the minimum version from there.
[#20407]: https://github.com/JuliaLang/julia/issues/20407
[#20414]: https://github.com/JuliaLang/julia/issues/20414
[#20418]: https://github.com/JuliaLang/julia/issues/20418
[#20500]: https://github.com/JuliaLang/julia/issues/20500
[#20974]: https://github.com/JuliaLang/julia/issues/20974
[#21197]: https://github.com/JuliaLang/julia/issues/21197
[#21257]: https://github.com/JuliaLang/julia/issues/21257
Expand Down
15 changes: 0 additions & 15 deletions src/compatmacro.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ is_index_style(arg) = false

istopsymbol(ex, mod, sym) = ex in (sym, Expr(:(.), mod, Expr(:quote, sym)))

if VERSION < v"0.6.0-dev.2782"
function new_style_typealias(ex::ANY)
isexpr(ex, :(=)) || return false
ex = ex::Expr
return length(ex.args) == 2 && isexpr(ex.args[1], :curly)
end
else
new_style_typealias(ex) = false
end

if !isdefined(Base, :UndefKeywordError)
struct UndefKeywordError <: Exception
kw
Expand Down Expand Up @@ -62,11 +52,6 @@ function _compat(ex::Expr)
elseif ex.head === :quote && isa(ex.args[1], Symbol)
# Passthrough
return ex
elseif new_style_typealias(ex)
ex.head = :typealias
elseif ex.head === :const && length(ex.args) == 1 && new_style_typealias(ex.args[1])
ex = ex.args[1]::Expr
ex.head = :typealias
end
if VERSION < v"0.6.0-dev.2840"
if ex.head == :(=) && isa(ex.args[1], Expr) && ex.args[1].head == :call
Expand Down
8 changes: 0 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,6 @@ end
@test isbitstype(Primitive20418{Int})
@test sizeof(Primitive20418{Int}) == 2

# PR #20500
@compat A20500{T<:Integer} = Array{T,20500}
@compat const A20500_2{T<:Union{Int,Float32}} = Pair{T,T}
f20500() = A20500
f20500_2() = A20500_2
@inferred f20500()
@inferred f20500_2()

module CompatArray
using Compat
const struct_sym = VERSION < v"0.7.0-DEV.1263" ? :type : :struct
Expand Down

0 comments on commit 3947c62

Please sign in to comment.