# Error reported in a blank line (MethodError: no method matching getindex(::Float64, ::UnitRange{Int64})

**URL:** <https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 17, 2020, 4:51pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766 "2020-02-17T16:51:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)\
**Post date:** [February 17, 2020, 4:51pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766/1 "2020-02-17T16:51:39Z")

</div>

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 ).

```julia
for i in 1:nDemes
        println("deme### ", i)
        NDeme = N_vec[i]
        println("begin_NDeme ",NDeme)
 #error reported in this line
        x = D[i]
        xwt = x[end,t-1]
        X = x[1:end-1,t-1]
        if !isempty(X)
               ss=xwt*s0
               xx=X+ss.*X #but actually is caused by this line
...

```

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [February 17, 2020, 4:59pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766/2 "2020-02-17T16:59:13Z")

</div>

> [@1634](#):
>
> Please save me from the println() locker.

😆

Two questions:

- are you using Revise? If so, does it happen if you don’t use Revise?
- does this persist on more recent Julia versions?

---

<div class="post-metadata">

**Author:** ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)\
**Post date:** [February 17, 2020, 5:04pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766/3 "2020-02-17T17:04:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)\
**Post date:** [February 18, 2020, 9:35pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766/4 "2020-02-18T21:35:44Z")

</div>

At the end this is found to be due to multiplying a constant with a vector while the error report is a bit distracting.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 18, 2020, 9:42pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766/5 "2020-02-18T21:42:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)\
**Post date:** [February 18, 2020, 9:46pm UTC](https://discourse.julialang.org/t/error-reported-in-a-blank-line-methoderror-no-method-matching-getindex-float64-unitrange-int64/34766/6 "2020-02-18T21:46:56Z")

</div>

I thought the orginal long debugging process doesn’t contain any useful information pointing to the cause of error 😋.
