<p dir="auto">Duplicate default label is a runtime error in JS, this should be a syntax error in TS</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="switch (moduleKind) {
            default: return ModuleKind.None;
            default: throw Error(&quot;unsuported ModuleKind value: &quot; + moduleKind);
}"><pre class="notranslate"><span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">moduleKind</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">default</span>: <span class="pl-k">return</span> <span class="pl-smi">ModuleKind</span><span class="pl-kos">.</span><span class="pl-c1">None</span><span class="pl-kos">;</span>
            <span class="pl-k">default</span>: <span class="pl-k">throw</span> <span class="pl-smi">Error</span><span class="pl-kos">(</span><span class="pl-s">"unsuported ModuleKind value: "</span> <span class="pl-c1">+</span> <span class="pl-s1">moduleKind</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Hi,</p>
<p dir="auto"><strong>TS</strong>: 1.4</p>
<p dir="auto">To reproduce.</p>
<ul dir="auto">
<li>
<p dir="auto">Create a TypeScript project in Visual Studio with "Compile on save" set to on.</p>
</li>
<li>
<p dir="auto">Add file <code class="notranslate">enums.d.ts</code> with code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare module enums {
  const enum Bar {
      one = 0,
      two = 1,
  }
}"><pre class="notranslate"><span class="pl-k">declare</span> module <span class="pl-s1">enums</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-k">enum</span> <span class="pl-smi">Bar</span> <span class="pl-kos">{</span>
      <span class="pl-c1">one</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">,</span>
      <span class="pl-c1">two</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
</li>
<li>
<p dir="auto">Add file <code class="notranslate">foo.ts</code> with code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;enums.d.ts&quot; /&gt;
var foo = enums.Bar.one;"><pre class="notranslate"><span class="pl-c">/// &lt;reference path="enums.d.ts" /&gt;</span>
<span class="pl-k">var</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">enums</span><span class="pl-kos">.</span><span class="pl-c1">Bar</span><span class="pl-kos">.</span><span class="pl-c1">one</span><span class="pl-kos">;</span></pre></div>
</li>
<li>
<p dir="auto">Compile the project and check that the output <code class="notranslate">foo.js</code> is correct:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;enums.d.ts&quot; /&gt;
var foo = 0 /* one */;"><pre class="notranslate"><span class="pl-c">/// &lt;reference path="enums.d.ts" /&gt;</span>
<span class="pl-k">var</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span> <span class="pl-c">/* one */</span><span class="pl-kos">;</span></pre></div>
</li>
<li>
<p dir="auto">Now trigger compile-on-save by saving <code class="notranslate">foo.ts</code>.</p>
</li>
<li>
<p dir="auto">The output in <code class="notranslate">foo.js</code> is now broken:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;enums.d.ts&quot; /&gt;
var foo = enums.Bar.one;"><pre class="notranslate"><span class="pl-c">/// &lt;reference path="enums.d.ts" /&gt;</span>
<span class="pl-k">var</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">enums</span><span class="pl-kos">.</span><span class="pl-c1">Bar</span><span class="pl-kos">.</span><span class="pl-c1">one</span><span class="pl-kos">;</span></pre></div>
</li>
</ul>
<p dir="auto">The following point is relevant: If the enum declaration is moved to <code class="notranslate">foo.ts</code> then things work correctly.</p>
<p dir="auto">This is a significant issue because the code fails with a runtime error.</p>