Skip to content

Commit

Permalink
Update delegate macro to work without warning on julia 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Mar 16, 2018
1 parent d99eebb commit 06ef1b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/delegate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ macro delegate(source, targets)
fieldname = unquote(source.args[2])
funcnames = targets.args
n = length(funcnames)
fdefs = Vector{Any}(n)
fdefs = Any[]
for i in 1:n
funcname = esc(funcnames[i])
fdefs[i] = quote
($funcname)(a::($typename), args...) =
($funcname)(a.$fieldname, args...)
end
push!(fdefs, quote
($funcname)(a::($typename), args...) =
($funcname)(a.$fieldname, args...)
end)
end
return Expr(:block, fdefs...)
end

0 comments on commit 06ef1b3

Please sign in to comment.