Skip to content

Commit

Permalink
Julia 0.6 compatibility change for type system rev (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
omus authored Jan 18, 2017
1 parent 7b7bc78 commit fe68377
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/expr.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fe68377

Please sign in to comment.