Hi folks,
I am having some problems getting some code to run inside a module. It runs fine when run directly in the REPL. Here is it:
mod_name = Symbol("HiGHS")
@eval using $mod_name
mod = getproperty(@__MODULE__, mod_name)
solver = optimizer_with_attributes(mod.Optimizer)
This runs as expected in the REPL, but inside a module I get:
ERROR: LoadError: The provided `optimizer_constructor` is invalid. It must be callable with zero arguments. For example, "Ipopt.Optimizer" or "() -> ECOS.Optimizer()". It should not be an instantiated optimizer like "Ipopt.Optimizer()" or "ECOS.Optimizer()". (Note the difference in parentheses!)