Skip to content

Commit

Permalink
Resolved issue of interpolating superclass name in caller's environment
Browse files Browse the repository at this point in the history
rjplevin committed Dec 27, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f4981c5 commit e8ae027
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Classes.jl
Original file line number Diff line number Diff line change
@@ -241,7 +241,9 @@ macro class(elements...)

# The explicit eval forces supername to be eval'd in calling environment
supername = (supername === nothing ? :Class : supername)
expr = :(eval(Classes._defclass($(QuoteNode(cls)), $supername, $mutable, $wheres, $exprs)))

# __module__ is a "hidden" arg passed to macros with the caller's Module
expr = _defclass(cls, __module__.eval(supername), mutable, wheres, exprs)
return esc(expr)
end

0 comments on commit e8ae027

Please sign in to comment.