Mauro <mauro...@runbox.com> writes:

>Unless someone else knows a fix, could you to put together a small test
>case and file an issue with Options.jl?

I have looked and it seems that the problem is kind of known but will
not be solved (?), rather the package will be obsoleted.

So for the moment, I will solve the issue by making a local copy of
the Options file, changing the module type and the datatype name, so
that standard "using Options" works.

The test case is as follows, in case somebody is interested.

Jan

-------------- file a.jl:

module a

require("Options")
using OptionsMod

export myfun

function myfun(opts)
    @defaults opts p=0
    println("myfun p=$p")
end

function testa()
    myfun(@options)
end

end

-------------- file b.jl:
module b

using a

require("Options")
using OptionsMod

function testb()
    myfun(@options)
end

end
----------------------

julia> import a ; a.testa()
WARNING: `require` is deprecated, use `using` or `import` instead

julia> import b ; b.testb()
ERROR: First argument must be an options type





>
>On Wed, 2015-09-30 at 18:33, Jan Kybic <jky...@gmail.com> wrote:
>> Hello,
>>            after switching to from Julia 0.3 to Julia 0.4 (release
>> candidate 3),  the Options package stopped working for me. I have several
>> modules, in each I call
>>
>> require("Options")
>> using OptionsMod
>>
>> A function from one module is called either from the same module or from
>> another using a call like "myfunction(a,b,@options)". Inside "myfunction",
>> the type of the last parameter is always
>>  "OptionsMod.Options{OptionsMod.CheckError}". However, the types do not
>> seem to be the same, "isa(opts,OptionsMod.Options)" give true in one case
>> and false in the latter and this leads to all sorts of errors like "method
>> not found".
>>
>> Do you know what is happening and how to avoid it? Perhaps as the module is
>> reloaded, it interferes with the precompilation?
>>
>> Thank you,
>>
>> Jan

-- 
-------------------------------------------------------------------------
Jan Kybic <ky...@fel.cvut.cz>                       tel. +420 2 2435 5721 
http://cmp.felk.cvut.cz/~kybic                              

Reply via email to