From fe68377c706b92486c9d2c0fe70205b177602d2e Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 17 Jan 2017 22:44:10 -0600 Subject: [PATCH] Julia 0.6 compatibility change for type system rev (#11) --- src/expr.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/expr.jl b/src/expr.jl index f5bb923..1e54eae 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 +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)