Skip to content

Commit

Permalink
Drop compat code for tr from #614
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 4, 2019
1 parent 6df3863 commit 8e49d89
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `strwidth` and `charwidth` are now merged into `textwidth` ([#23667]).

* `trace` is now `tr`, available as `Compat.tr` ([#26365]).

* `Associative` is now `AbstractDict` ([#25012]).

* `indices` is now `axes` ([#25057]). This function is not exported from Compat to avoid
Expand Down
9 changes: 1 addition & 8 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,11 @@ import Serialization
import Statistics
import Base: Fix2
import Base64
const tr = LinearAlgebra.tr


include("compatmacro.jl")

# julia #26365
@static if isdefined(LinearAlgebra, :tr)
const tr = LinearAlgebra.tr
else
# 0.6
const tr = LinearAlgebra.trace
end

if VERSION < v"0.7.0-DEV.1930"
# no textwidth definition in Base
export textwidth
Expand Down
3 changes: 3 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ module Test24361
@test String(Compat.Base64.base64decode("SGVsbG8h")) == "Hello!"
end

# julia#26365
@test Compat.tr([1 2; 3 5]) == 6


# tests of removed functionality (i.e. justs tests Base)

Expand Down
3 changes: 0 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ if VERSION >= v"0.7"
end
end

# julia#26365
@test Compat.tr([1 2; 3 5]) == 6

let
x = view(1:10, 2:4)
D = Diagonal(x)
Expand Down

0 comments on commit 8e49d89

Please sign in to comment.