Guys,
The problem is not related with the global constants, but with the internal K1
. This other code reproduces the problem as well:
VERSION >= v"0.4.0-dev+6521" && __precompile__()
module TestConst
export test
function test(n::Number, e::Number)
# Check if the arguments are valid.
if (n <= 0)
throw(ArgumentError("The angular velocity must be greater than 0."))
end
# Auxiliary constant to compute the functions.
K1 = 3.0
# Declare the functions that must solved for 0.
f1(a, i) = K1
end
end
Notice that, if I remove the exceptions, then everything is fine:
Variables:
#self# <optimized out>
n <optimized out>
e <optimized out>
K1 <optimized out>
f1::TestConst.#f1#1{Float64}
Am I missing something?