<p dir="auto">Dear julia community, when running <code class="notranslate">eval</code> on an expressions of an expression the <code class="notranslate">typ</code> information is unexpactedly lost:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; expr1 = :(sin(1))
&gt; expr1.typ = Float32
&gt; print(expr1)
sin(1)::Float32
&gt; expr2 = Expr(:quote, expr1)
&gt; eval(expr2).typ
Any"><pre class="notranslate"><code class="notranslate">&gt; expr1 = :(sin(1))
&gt; expr1.typ = Float32
&gt; print(expr1)
sin(1)::Float32
&gt; expr2 = Expr(:quote, expr1)
&gt; eval(expr2).typ
Any
</code></pre></div>
<p dir="auto">Julia: 0.5.1<br>
Operating System: Windows 10</p>
<p dir="auto">I thought that a <code class="notranslate">QuoteNode</code> as meant as a bulletproof way to be able to shield an expression from the compiler poking into it while e.g. returning it from a macro. But consider the following code with a macro which wraps an expression in a <code class="notranslate">QuoteNode</code> and returns it:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="macro l()
    QuoteNode(Expr(:block, (Expr(:line,42,:none)), :(f(x))))
end
show(typeof(@l().args[1]))"><pre class="notranslate"><code class="notranslate">macro l()
    QuoteNode(Expr(:block, (Expr(:line,42,:none)), :(f(x))))
end
show(typeof(@l().args[1]))
</code></pre></div>
<p dir="auto">This prints <code class="notranslate">LineNumberNode</code>, which means that the <code class="notranslate">Expr(:line,42,:none)</code> has turned into a <code class="notranslate">LineNumberNode</code>.</p>
<p dir="auto">Should this be corrected, or do I misunderstand the intent of <code class="notranslate">QuoteNode</code>? If I do, does there exist a bulletproof way to shield an expression from the compiler?</p>