Hi, I have a function MarginsRnd. When I try to use the function, it
complains that the types are not correct - but I do not see why. Restarting
Julia and reloading the function does not work. The problem seems to be in
a strangely defined method. When I run whos() I get:
whos()
Base 23988 KB Module : Base
MarginsRnd 3405 bytes Function : MarginsRnd
Core 2832 KB Module : Core
Main 26642 KB Module : Main
Switch 13 KB Module : Switch
__MarginsRnd#2__ 21 KB Function : __MarginsRnd#2__
__canonical#0__ 1073 bytes Function : __canonical#0__
__canonical#1__ 11 KB Function : __canonical#1__
ans 24 bytes Tuple{DataType,DataType,
DataType} : (Int64,Array{Int64,1},Array{Int64,1})
canonical 3383 bytes Function : canonical
p 104 bytes 13-element Array{Int64,1} : [14
,13,14,10,12,2,10,1,10,11,6,2,17]
q 136 bytes 17-element Array{Int64,1} : [4,
4,11,10,10,8,9,10,8,9,3,10,4,7,9,3,3]
So the function seems to have a #2 method, but not a #0 method for some
reason. When I run the codes I get error message:
julia> MarginsRnd(2,p,q)
ERROR: MethodError: `__MarginsRnd#2__` has no method matching
__MarginsRnd#2__(::Array{Float64,2},
::ASCIIString, ::ASCIIString, ::ASCIIString, ::Array{Float64,2}, ::Bool,
::Int64, ::Array{Int64,1}, ::Array{Int64,1})
Closest candidates are:
__MarginsRnd#2__(::Array{AbstractFloat,2}, ::ASCIIString, ::ASCIIString,
::AbstractString, ::Array{Int64,2}, ::Any, ::Int64, ::Array{Int64,1},
::Array{Int64,1})
I have no idea how the types of the candidates have appeared.
Simple querying shows:
julia> methods(MarginsRnd)
# 1 method for generic function "MarginsRnd":
MarginsRnd(N::Int64, r::Array{Int64,1}, c::Array{Int64,1}) at none:69
julia> map(typeof, (2, p, q))
(Int64,Array{Int64,1},Array{Int64,1})
Anyone who can give me an idea what is wrong here?
Thanks a lot!