<p dir="auto">Hi there,</p>
<p dir="auto">I installed 1.3 yesterday and my application no longer compiles correctly. Here's an example:</p>
<p dir="auto"><strong>TS Input</strong><br>
import a = require("../dir1/file1");<br>
import MongoClient = require('mongodb');<br>
import b = require('../dir1/file2');<br>
import c = require("../dir2/file1");</p>
<p dir="auto"><strong>JS Output</strong><br>
var c = require("../dir2/file1");</p>
<p dir="auto">For some reason three of the four lines did not make it into the JS file. All worked fine before I installed the new TypeScript.</p>
<p dir="auto">Any thoughts?</p>
<p dir="auto">I've just come across a problem with <code class="notranslate">tsc</code> (version 1.1.0.0) which I've reduced to the following repro code. Suppose we have the following in <code class="notranslate">main.ts</code>:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import a = require('./main'); // doesn't matter what is required as long as tsc can find it
var b = a; // or any expression referring to 'a'
var c: typeof a;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> require<span class="pl-kos">(</span><span class="pl-s">'./main'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// doesn't matter what is required as long as tsc can find it</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">a</span><span class="pl-kos">;</span> <span class="pl-c">// or any expression referring to 'a'</span>
<span class="pl-k">var</span> <span class="pl-s1">c</span>: <span class="pl-k">typeof</span> <span class="pl-s1">a</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Compiling this with <code class="notranslate">tsc main --module commonjs</code> gives me the following output:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var b = a;
var c;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">a</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">c</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Note that no <code class="notranslate">var a = ...</code> has been emitted, and running the code results in <code class="notranslate">ReferenceError: a is not defined</code>.</p>
<p dir="auto">If the third line (<code class="notranslate">var c: typeof a</code>) is commented out or doesn't refer to <code class="notranslate">a</code>, then the <code class="notranslate">var a = ...</code> line <em>is</em> emitted as expected.</p>