From e8ae0271f524eae15e6cf3830e1166ad107236a3 Mon Sep 17 00:00:00 2001 From: Richard Plevin Date: Wed, 26 Dec 2018 16:45:25 -0800 Subject: [PATCH] Resolved issue of interpolating superclass name in caller's environment --- src/Classes.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Classes.jl b/src/Classes.jl index 62b448b..9498e5c 100644 --- a/src/Classes.jl +++ b/src/Classes.jl @@ -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