I am having an error that I don’t understand. The code works on the REPL but it doesn’t when called from the terminal (after being compiled with Comonicon):
There is this struct called State, and it’s constructor that accepts keyword arguments. I am able to initialize and use it on the REPL, but on the terminal it throws this error, which is crazy because it is complaining that a method does not exist when it exists (as it shows me it exists). What am I missing? Can it be a world age bug?
The code is rather big and on a private repo, so I will try to put the corresponding parts here, but I don’t know if it is going to be enough.
state_signature = generate_state_signature(initial_conditions)
fields = map(x -> Meta.parse(x), split(state_signature))
function State($(fields...), timestep::Int64, substep::Int64)
new($(fields...), timestep::Int64, substep::Int64)
State(; $(fields...), timestep::Int64 = 1, substep::Int64 = 1) = State($(fields...), timestep::Int64, substep::Int64)
state_signature = ""
for (variable, value) in pairs(initial_conditions)
type = typeof(value)
state_signature *= "$variable::$type "
This functions gets eval’d based on the named tuple. The constructor should accept keyword arguments, and it does on the REPL, but not on the terminal.