The module testModule (below) defines method iterlocal that calls localindices.
testModule uses DistributedArrays and SharedArrays, which impose mutually-exclusive parametric constraints on localindices so there is no ambiguity when that method is called from iterlocal (without qualification), yet the compiler complains.
How is this behavior consistent with multiple-dispatch?
What is the preferred way to handle this?
module testModule
using DistributedArrays,SharedArrays
export iterlocal
function iterlocal(arr)
for i in localindices(arr)
println(arr[i])
end
end
end
using DistributedArrays,SharedArrays
a = distribute(fill(rand(2,10),3)) # this is a DArray, it only matches the signature of DistributedArrays.iterlocal
test.iterlocal(a)
julia> testMethod.iterlocal(a)
WARNING: both SharedArrays and DistributedArrays export "localindices"; uses of it in module test must be qualified