<p dir="auto">Hi,<br>
I installed Visual Studio Community 2013 and Typescript 1.4. When I changed all my enums to const enum (btw, very nice feature, thanks!) I noticed that compile-on-save feature doesn't  handle this feature well.</p>
<p dir="auto">When I use those const enums in other file than the one it was defined in then when I save file, they are not resolved to constant numbers.</p>
<p dir="auto">For example I have file firstFile.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const enum TestEnum {
    Foo, Bar
}

var testFirstFile = TestEnum.Bar;"><pre class="notranslate"><code class="notranslate">const enum TestEnum {
    Foo, Bar
}

var testFirstFile = TestEnum.Bar;
</code></pre></div>
<p dir="auto">and when I save file (by pressing Ctrl+S) i get file firstFile.js:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var testFirstFile = 1 /* Bar */;
//# sourceMappingURL=firstFile.js.map"><pre class="notranslate"><code class="notranslate">var testFirstFile = 1 /* Bar */;
//# sourceMappingURL=firstFile.js.map
</code></pre></div>
<p dir="auto">but When i have secondFile.ts file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;firstfile.ts&quot; /&gt;

var testInOtherFile = TestEnum.Bar;"><pre class="notranslate"><code class="notranslate">/// &lt;reference path="firstfile.ts" /&gt;

var testInOtherFile = TestEnum.Bar;
</code></pre></div>
<p dir="auto">and save file I get secondFile.js:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;firstfile.ts&quot; /&gt;
var testInOtherFile = TestEnum.Bar;
//# sourceMappingURL=secondFile.js.map"><pre class="notranslate"><code class="notranslate">/// &lt;reference path="firstfile.ts" /&gt;
var testInOtherFile = TestEnum.Bar;
//# sourceMappingURL=secondFile.js.map
</code></pre></div>
<p dir="auto">only when I build project in Visual Studio I get proper secondFile.js file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;firstfile.ts&quot; /&gt;
var testInOtherFile = 1 /* Bar */;
//# sourceMappingURL=secondFile.js.map"><pre class="notranslate"><code class="notranslate">/// &lt;reference path="firstfile.ts" /&gt;
var testInOtherFile = 1 /* Bar */;
//# sourceMappingURL=secondFile.js.map
</code></pre></div>
<ul dir="auto">
<li>have two external modules (a.ts which defines and exports an enum, b.ts which uses the enum)</li>
<li>emit the JS code for b.ts</li>
<li>emit the JS code for a.ts and notice that the enum reference is inlined (<code class="notranslate">console.log(0 /*A*/);</code>)</li>
<li>change a.ts and emit only that file again</li>
<li>=&gt; now the enum is <em>not</em> inlined anymore (<code class="notranslate">console.log(Foo.A);</code>). I can debug this into checker#getConstantValue which discovers the enum value but fails to find a proper node link. I guess this is because changing a.ts cleared some type caches)</li>
</ul>
<p dir="auto">a.ts</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import Foo = require('./b');
console.log(Foo.A);"><pre class="notranslate"><code class="notranslate">import Foo = require('./b');
console.log(Foo.A);
</code></pre></div>
<p dir="auto">b.ts</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="enum Foo {
    A = 0,
    B = 1,
    C = 2
}

export = Foo;"><pre class="notranslate"><code class="notranslate">enum Foo {
    A = 0,
    B = 1,
    C = 2
}

export = Foo;
</code></pre></div>