Skip to content

Commit

Permalink
Merge pull request #329 from yuyichao/yyc/0.7
Browse files Browse the repository at this point in the history
Fix loading on 0.7
  • Loading branch information
yuyichao authored Sep 15, 2017
2 parents 08683b4 + bb7b51f commit 880480f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/delegate.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# by JMW

function unquote(e::Expr)
@assert e.head == :quote
return e.args[1]
end

function unquote(e::QuoteNode)
return e.value
end

macro delegate(source, targets)
typename = esc(source.args[1])
fieldname = source.args[2].args[1]
fieldname = unquote(source.args[2])
funcnames = targets.args
n = length(funcnames)
fdefs = Vector{Any}(n)
Expand All @@ -17,7 +27,7 @@ end

macro delegate_return_parent(source, targets)
typename = esc(source.args[1])
fieldname = source.args[2].args[1]
fieldname = unquote(source.args[2])
funcnames = targets.args
n = length(funcnames)
fdefs = Vector{Any}(n)
Expand Down

0 comments on commit 880480f

Please sign in to comment.