The following code works on 0.5, but not on 0.6 (0.6.0-pre.alpha.0)
macro macroex(n)
:(println($n))
end
type MWE
nvar :: Int
x0 :: Array{Float64,1}
function MWE(nvar)
x0 = zeros(nvar)
@macroex nvar # <-- Fails here
return new(nvar, x0)
end
end
function foo()
@macroex 5
mwe = MWE(5)
println(mwe.x0)
end
foo()
on line 11 (annotated) with ERROR: LoadError: UndefVarError: nvar not defined
.
Any input is greatly appreciated.
Thanks in advance.