<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.0-beta</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="for (const v of [1,2,3]);"><pre class="notranslate"><span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-s1">v</span> <span class="pl-k">of</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto">A compiler error: re-assignment of <code class="notranslate">const</code>-variable in loop.</p>
<p dir="auto"><strong>Actual behavior:</strong></p>
<p dir="auto">Compiled successfully.</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.7</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type OnlyNumberKeys = {[key: number]: any};
let a: OnlyNumberKeys = {};

a[&quot;abcd&quot;] = 1; // No error?
let x = a[&quot;abcd&quot;]; // No error?"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">OnlyNumberKeys</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">[</span><span class="pl-s1">key</span>: <span class="pl-smi">number</span><span class="pl-kos">]</span>: <span class="pl-smi">any</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">a</span>: <span class="pl-smi">OnlyNumberKeys</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">a</span><span class="pl-kos">[</span><span class="pl-s">"abcd"</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// No error?</span>
<span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">a</span><span class="pl-kos">[</span><span class="pl-s">"abcd"</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// No error?</span></pre></div>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type OnlyStringKeys = {[key: string]: any};
let b: OnlyStringKeys = {};

b[1234] = 1; // No error?
let y = b[1234]; // No error?"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">OnlyStringKeys</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">[</span><span class="pl-s1">key</span>: <span class="pl-smi">string</span><span class="pl-kos">]</span>: <span class="pl-smi">any</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">b</span>: <span class="pl-smi">OnlyStringKeys</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-s1">b</span><span class="pl-kos">[</span><span class="pl-c1">1234</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// No error?</span>
<span class="pl-k">let</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">b</span><span class="pl-kos">[</span><span class="pl-c1">1234</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// No error?</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
Should error</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
Doesn't error</p>
<p dir="auto"><em>(Sorry if this is a duplicate but a search did not yield anything on this)</em></p>