Question solved: At the end this is found to be due to multiplying a constant with a vector, while the error report is a bit distracting (in line much ).
for i in 1:nDemes
println("deme### ", i)
NDeme = N_vec[i]
#error reported in this line
x = D[i]
xwt = x[end,t-1]
X = x[1:end-1,t-1]
xx=X+ss.*X #but actually is caused by this line
Thanks. I havn’t used package Revise, after updating the version from 1.2.0 to 1.3.1, the error report remains in the same blank line.
At the end this is found to be due to multiplying a constant with a vector while the error report is a bit distracting.
Instead of editing your original question to put the solution, it can be much more helpful to post the solution as a new post — you can even mark it with a to say it’s solved. That way folks who have similar issues can continue to read, understand, and even find the thread from Google in the future.
I thought the orginal long debugging process doesn’t contain any useful information pointing to the cause of error .