-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Compat for Julia #18510, #18484 #287
Conversation
thanks, add to README |
709be58
to
50656ea
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.
lgtm!
Thanks! cc @nalimilan who may be interested |
@tkelman how many reviews does this need? |
@@ -613,6 +613,8 @@ function _compat(ex::Expr) | |||
elseif VERSION < v"0.5.0-dev+4340" && length(ex.args) > 3 && | |||
istopsymbol(withincurly(ex.args[1]), :Base, :show) | |||
ex = rewrite_show(ex) | |||
elseif VERSION < v"0.6.0-dev.826" && f === :Nullable && length(ex.args) == 3 # julia#18510 | |||
ex = Expr(:call, :Nullable, ex.args[2], Expr(:call, :(Compat._Nullable_field2), ex.args[3])) |
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.
This does not handle Nullable{Int}(x, b)
properly. See how show
is handled above (need withincurly
and istopsymbol
).
i.e. condition should be istopsymbol(withincurly(f), :Base, :Nullable)
and return value should be Expr(:call, f, ex.args[2], ...)
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.
LGTM except for this.
50656ea
to
e49e36b
Compare
Good catch -- thanks, @TotalVerb . I've made those changes and added tests. |
@@ -613,6 +613,9 @@ function _compat(ex::Expr) | |||
elseif VERSION < v"0.5.0-dev+4340" && length(ex.args) > 3 && | |||
istopsymbol(withincurly(ex.args[1]), :Base, :show) | |||
ex = rewrite_show(ex) | |||
elseif VERSION < v"0.6.0-dev.826" && length(ex.args) == 3 && # julia#18510 | |||
istopsymbol(withincurly(ex.args[1]), :Base, :Nullable) | |||
ex = Expr(:call, :Nullable, ex.args[2], Expr(:call, :(Compat._Nullable_field2), ex.args[3])) |
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.
Expr(:call, f
or Expr(:call, ex.args[1]
. Currently it doesn't behave properly for Nullable{Any}(1.0, false)
(maybe add that as a test).
e49e36b
to
11b9210
Compare
Thanks again for your thoroughness |
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.
LGTM.
Previous tests would pass even if `Nullable{Any}` was rewritten to `Nullable`.
@davidagold I added two test cases for |
Assuming no-one objects to tagging this. JuliaLang/METADATA.jl#6791 |
Was added in #287, now obsolete as no longer required on minimum supported Julia version 0.6.
* Remove at-compat for type aliases Was added in #326, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for Nullable construction Was added in #287, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for Foo{<:Bar} sugar Was added in #317 (and #336), now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for index styles Was added in #329, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove at-compat for type declarations Was added in #325, now obsolete as no longer required on minimum supported Julia version 0.6. * Remove unused at-compat helper functions * Remove README entries for removed at-compat functionality * new style call overloading (added in #181, removed in #385) * `get(io, s false)` (added in #212, #215, #225, removed in #385) * `.=` (added in #292 and #316, removed in #372) * Remove `Compat.collect(A)` Was added in #350 and #351, now obsolete as no longer required on minimum supported Julia version 0.6.
* Remove `take!(::Task)` definition for Julia versions prior to 0.6 Was added in #307. * Remove `redirect_std*(f, stream)` definitions for Julia prior to v0.6 Were added in #275. * Remove at-__DIR__ macro definition for Julia versions prior to 0.6 Was added in #281. * Remove `broadcast` definition for equal-length tuples Was added in #324 and #328 * Remove definitions of `unsafe_get` and `isnull` fallsback Were added in #287. * Remove defintions of `xor` and `⊻` Were added in #289. * Definitions of `numerator` and `denominator` Were added in #290. * Remove defintion of `iszero` Was added in #305. * Remove definition of `>:` Was added in #336 * Remove definition of `take!(::Base.AbstractIOBuffer)` Was added in #290. * Remove definiton of `.&` and `.|` Were added in #306. * Remove definition of `Compat.isapprox` Was added in #309.
Compatibility for JuliaLang/julia#18510 and JuliaLang/julia#18484.
@tkelman c.f. davidagold/StructuredQueries.jl@a8ede17#commitcomment-19450532