From 31c8c84f748257d5084979b2485a679632f84c15 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 17 Jan 2017 14:58:31 -0600 Subject: [PATCH 1/2] Julia 0.6 compatibility change for type system rev --- src/expr.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/expr.jl b/src/expr.jl index f5bb923..d804034 100644 --- a/src/expr.jl +++ b/src/expr.jl @@ -1,3 +1,11 @@ +# Note: Needed for compatibility with the Julia 0.6 type system change: +# https://github.com/JuliaLang/julia/pull/18457 +if isdefined(Base, :unwrap_unionall) + import Base: unwrap_unionall +else + unwrap_unionall(t::Type) = t.name +end + function extract_bindings(exprs::AbstractArray) bindings = Set{Union{Expr,Symbol}}() for ex in exprs @@ -30,7 +38,8 @@ function extract_bindings(exprs::AbstractArray) end function binding_expr(t::Type) - joinbinding(fullname(t.name.module)..., t.name.name) + type_name = unwrap_unionall(t).name + joinbinding(fullname(type_name.module)..., type_name.name) end function binding_expr(f::Function) m = Base.function_module(f, Tuple) From 41915af7dc569448c734ea7e2ecfbca8855a811f Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 17 Jan 2017 14:58:31 -0600 Subject: [PATCH 2/2] Fixup for pre-0.6 --- src/expr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expr.jl b/src/expr.jl index d804034..1e54eae 100644 --- a/src/expr.jl +++ b/src/expr.jl @@ -3,7 +3,7 @@ if isdefined(Base, :unwrap_unionall) import Base: unwrap_unionall else - unwrap_unionall(t::Type) = t.name + unwrap_unionall(t::Type) = t end function extract_bindings(exprs::AbstractArray)