<p dir="auto">Go spec says:</p>
<blockquote>
<p dir="auto">Converting a signed or unsigned integer value to a string type yields a string containing the UTF-8 representation of the integer. Values outside the range of valid Unicode code points are converted to "\uFFFD".</p>
</blockquote>
<ol dir="auto">
<li>cmd/compile rejects <code class="notranslate">string(1&lt;&lt;100)</code> instead of yielding <code class="notranslate">"\uFFFD"</code>: <a href="http://play.golang.org/p/1s6ge-XFqd" rel="nofollow">http://play.golang.org/p/1s6ge-XFqd</a>  (gccgo also rejects this; gotype accepts it.)</li>
<li>runtime incorrectly truncates 64-bit integer values to uint32 before checking if they're a valid Unicode code point: <a href="http://play.golang.org/p/M_Gkll5VY-" rel="nofollow">http://play.golang.org/p/M_Gkll5VY-</a></li>
</ol>
<p dir="auto">Gc rejects to compile the following program:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package a
var a = string(9223372036854775808)"><pre class="notranslate"><span class="pl-k">package</span> a
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-en">string</span>(<span class="pl-c1">9223372036854775808</span>)</pre></div>
<p dir="auto">saying:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="overflow in int -&gt; string"><pre class="notranslate"><code class="notranslate">overflow in int -&gt; string
</code></pre></div>
<p dir="auto">go/types compile it successfully.</p>
<p dir="auto">Compilers must agree on whether it is a valid Go program or not.</p>
<p dir="auto">on commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/golang/go/commit/af817890aa7b628234075a6cb01a3a435fb8317d/hovercard" href="https://github.com/golang/go/commit/af817890aa7b628234075a6cb01a3a435fb8317d"><tt>af81789</tt></a></p>