<p dir="auto">I'm new to Julia. I wonder why the loop in the following code isn't unrolled.<br>
The operator '*' here is pure and have no side effects. I've checked @code_native for the same code with native types and it's looks it's unrolled correctly.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function test(n::Int, count::Int)
           A = rand(n, n)
           x = rand(n)
           y = zeros(n)
           tic()
           for i = 1 : count
               y = A * x
           end
           toq()
       return y
       end"><pre class="notranslate"><code class="notranslate">function test(n::Int, count::Int)
           A = rand(n, n)
           x = rand(n)
           y = zeros(n)
           tic()
           for i = 1 : count
               y = A * x
           end
           toq()
       return y
       end
</code></pre></div>
<p dir="auto">lang: Julia v3.11<br>
OS: Windows/Linux</p>
<p dir="auto">This seems inconsistent and undesirable:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; a = fill(1)
0-dimensional Array{Int64, 0}:
1

julia&gt; Float64.(a)
1.0

julia&gt; map(Float64, a)
0-dimensional Array{Float64, 0}:
1.0"><pre class="notranslate">julia<span class="pl-k">&gt;</span> a <span class="pl-k">=</span> <span class="pl-c1">fill</span>(<span class="pl-c1">1</span>)
<span class="pl-c1">0</span><span class="pl-k">-</span>dimensional Array{Int64, <span class="pl-c1">0</span>}<span class="pl-k">:</span>
<span class="pl-c1">1</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">Float64</span>.(a)
<span class="pl-c1">1.0</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">map</span>(Float64, a)
<span class="pl-c1">0</span><span class="pl-k">-</span>dimensional Array{Float64, <span class="pl-c1">0</span>}<span class="pl-k">:</span>
<span class="pl-c1">1.0</span></pre></div>