-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix deprecated array constructors #348
Conversation
Waiting for JuliaLang/METADATA.jl#12295 |
This will fail because of JuliaLang/Compat.jl#416 (comment) |
56a125b
to
64026e8
Compare
Well, tests pass on 0.6 now, but |
Codecov Report
@@ Coverage Diff @@
## master #348 +/- ##
=========================================
+ Coverage 96.45% 96.5% +0.04%
=========================================
Files 31 31
Lines 2286 2287 +1
=========================================
+ Hits 2205 2207 +2
+ Misses 81 80 -1
Continue to review full report at Codecov.
|
576807a
to
fd742b0
Compare
Ooops, yes, sorry, I had missed that you had updated this PR, too. |
src/DataStructures.jl
Outdated
@static if VERSION < v"0.7.0-DEV.2437" | ||
_include_string(str) = eval(parse(str)) | ||
else | ||
_include_string(str) = eval(Meta.parse(str)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be used unconditionally, because Meta.parse
is available on 0.6, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right.
07d19a6
to
aa3460b
Compare
Rebased and removed the |
aa3460b
to
57ff7f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing looks egregious.
src/ordered_dict.jl
Outdated
_oldOrderedDict1 = "OrderedDict{V}(kv::Tuple{Vararg{Pair{TypeVar(:K),V}}}) = OrderedDict{Any,V}(kv)" | ||
_newOrderedDict1 = "OrderedDict{V}(kv::Tuple{Vararg{Pair{K,V} where K}}) = OrderedDict{Any,V}(kv)" | ||
_oldOrderedDict1 = "OrderedDict(kv::Tuple{Vararg{Pair{TypeVar(:K),V}}}) where {V} = OrderedDict{Any,V}(kv)" | ||
_newOrderedDict1 = "OrderedDict(kv::Tuple{Vararg{Pair{K,V} where K}}) where {V} = OrderedDict{Any,V}(kv)" | ||
OrderedDict(kv::Tuple{Vararg{Pair{K,V}}}) where {K,V} = OrderedDict{K,V}(kv) | ||
OrderedDict(kv::Tuple{Vararg{Pair{K}}}) where {K} = OrderedDict{K,Any}(kv) | ||
VERSION < v"0.6.0-dev.2123" ? _include_string(_oldOrderedDict1) : _include_string(_newOrderedDict1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Julia <0.6 release is not supported, so this stuff can go, and just the real code can be put in.
src/ordered_dict.jl
Outdated
_oldOrderedDict2 = "OrderedDict{V}(ps::Pair{TypeVar(:K),V}...,) = OrderedDict{Any,V}(ps)" | ||
_newOrderedDict2 = "OrderedDict{V}(ps::(Pair{K,V} where K)...,) = OrderedDict{Any,V}(ps)" | ||
_oldOrderedDict2 = "OrderedDict(ps::Pair{TypeVar(:K),V}...,) where {V} = OrderedDict{Any,V}(ps)" | ||
_newOrderedDict2 = "OrderedDict(ps::(Pair{K,V} where K)...,) where {V} = OrderedDict{Any,V}(ps)" | ||
OrderedDict(ps::Pair{K,V}...) where {K,V} = OrderedDict{K,V}(ps) | ||
OrderedDict(ps::Pair{K}...,) where {K} = OrderedDict{K,Any}(ps) | ||
VERSION < v"0.6.0-dev.2123" ? _include_string(_oldOrderedDict2) : _include_string(_newOrderedDict2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@test findfirst(s,2) == 0 | ||
@test findfirst(equalto(1), s) == 1 | ||
@test findfirst(equalto(7), s) == 4 | ||
@test findfirst(equalto(2), s) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these are coming in from Compat
?
It is a nice feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, JuliaLang/julia#23812 on master and JuliaLang/Compat.jl#405 in Compat.
- use uninitialized for Array and BitArray constructors - parse -> Meta.parse - findfirst(x, v) -> findfirst(equalto(v), x) - some syntax deprecation warnings for parametric methods
57ff7f5
to
ef72847
Compare
Removed the old code, which lets us remove the |
No description provided.