# Depreciation warning with ones()

**URL:** https://discourse.julialang.org/t/depreciation-warning-with-ones/11962
**Category:** New to Julia
**Created:** [June 26, 2018, 12:48pm UTC](https://discourse.julialang.org/t/depreciation-warning-with-ones/11962 "2018-06-26T12:48:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ckoe-bccms](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ckoe-bccms/32/1816_2.png) [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)
#### Post date: [June 26, 2018, 12:48pm UTC](https://discourse.julialang.org/t/depreciation-warning-with-ones/11962/1 "2018-06-26T12:48:24Z")

</div>

Hello everybody,

I have a brief question regarding a depreciation warning I get on 0.7-beta.

Consider

```julia
julia> m=2.0
2.0

julia> ones(m)
┌ Warning: `ones(dims...)` is deprecated, use `ones(convert(Dims, dims)...)` instead.
│ caller = top-level scope at none:0
└ @ Core none:0
2-element Array{Float64,1}:
 1.0
 1.0

```

Obviously the fact that m is a Float64 scalar is the problem (and was in fact a bug). However it took me several minutes to understand this because of the wording of the Warning which I think is highly confusing. From “convert(Dims, dims)” I was looking for an actual multi-dimensional object as the trigger and at first assumed this Warning was completely bogus.

Does it make sense to file a bug report about this ?

In any case someone else might now be able to save some minutes if google picks this up.

Cheers

Christof

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 26, 2018, 12:50pm UTC](https://discourse.julialang.org/t/depreciation-warning-with-ones/11962/2 "2018-06-26T12:50:50Z")

</div>

As you surmised, all this is telling you is to pass it an integer instead of a float. Good deprecation messages are hard—you can usually do correct or simple but often not both. This particular one could probably be specialized to be less confusing. An issue about improving it would be helpful!

---

<div class="post-metadata">

### Author: ![ckoe-bccms](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ckoe-bccms/32/1816_2.png) [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)
#### Post date: [June 26, 2018, 1:06pm UTC](https://discourse.julialang.org/t/depreciation-warning-with-ones/11962/3 "2018-06-26T13:06:18Z")

</div>

Hello,

This is done, #27795.

Best Regards

Christof
