<p dir="auto">I can't explain the difference between the two arrays built via the comprehension syntax.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; [a for a in ntuple(3, i -&gt; i)]
3-element Array{Any,1}:
 1
 2
 3

julia&gt; xdump(ntuple(3, i -&gt; i))
(Int64,Int64,Int64) (1,2,3)

julia&gt; ntuple(3, i -&gt; i) === (1, 2, 3)

julia&gt; [a for a in (1, 2, 3)]
3-element Array{Int64,1}:
 1
 2
 3"><pre class="notranslate">julia<span class="pl-k">&gt;</span> [a <span class="pl-k">for</span> a <span class="pl-k">in</span> <span class="pl-c1">ntuple</span>(<span class="pl-c1">3</span>, i <span class="pl-k">-&gt;</span> i)]
<span class="pl-c1">3</span><span class="pl-k">-</span>element Array{Any,<span class="pl-c1">1</span>}<span class="pl-k">:</span>
 <span class="pl-c1">1</span>
 <span class="pl-c1">2</span>
 <span class="pl-c1">3</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">xdump</span>(<span class="pl-c1">ntuple</span>(<span class="pl-c1">3</span>, i <span class="pl-k">-&gt;</span> i))
(Int64,Int64,Int64) (<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>)

julia<span class="pl-k">&gt;</span> <span class="pl-c1">ntuple</span>(<span class="pl-c1">3</span>, i <span class="pl-k">-&gt;</span> i) <span class="pl-k">===</span> (<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>)

julia<span class="pl-k">&gt;</span> [a <span class="pl-k">for</span> a <span class="pl-k">in</span> (<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>)]
<span class="pl-c1">3</span><span class="pl-k">-</span>element Array{Int64,<span class="pl-c1">1</span>}<span class="pl-k">:</span>
 <span class="pl-c1">1</span>
 <span class="pl-c1">2</span>
 <span class="pl-c1">3</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   _       _ _(_)_     |
  (_)     | (_) (_)    |  A fresh approach to technical computing
   _ _   _| |_  __ _   |
  | | | | | | |/ _` |  |  Version 0.0.0-prerelease
  | | |_| | | | (_| |  |  Commit 335d1ef401 (2012-03-04 23:47:29)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |

julia&gt; x = 5
5

julia&gt; typeof(x)
Int64

julia&gt; typeof([i | i = 1:5])
Array{Int64,1}"><pre class="notranslate"><code class="notranslate">   _       _ _(_)_     |
  (_)     | (_) (_)    |  A fresh approach to technical computing
   _ _   _| |_  __ _   |
  | | | | | | |/ _` |  |  Version 0.0.0-prerelease
  | | |_| | | | (_| |  |  Commit 335d1ef401 (2012-03-04 23:47:29)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |

julia&gt; x = 5
5

julia&gt; typeof(x)
Int64

julia&gt; typeof([i | i = 1:5])
Array{Int64,1}
</code></pre></div>
<p dir="auto">So far, so good.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; typeof([i | i = 1:x])
Array{Any,1}"><pre class="notranslate"><code class="notranslate">julia&gt; typeof([i | i = 1:x])
Array{Any,1}
</code></pre></div>
<p dir="auto">Wat.<br>
(with apologies to <a href="https://www.destroyallsoftware.com/talks/wat" rel="nofollow">https://www.destroyallsoftware.com/talks/wat</a>)</p>