<p dir="auto">Hi.</p>
<p dir="auto">I have updated my typescript (<code class="notranslate">npm install typescript -g</code>) recently and now I have an issue with some multiple references to the same file.</p>
<p dir="auto">It worked fine under TS 1.0.</p>
<p dir="auto"><strong>shared/app/Sails.ts</strong>:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="///&lt;reference path='./lib/def/defLoader.d.ts'/&gt;

import cli = require('./../../shared/app/Cli');
var Cli = cli.Cli;

export class Sails{

}"><pre class="notranslate"><span class="pl-c">///&lt;reference path='./lib/def/defLoader.d.ts'/&gt;</span>

<span class="pl-k">import</span> <span class="pl-s1">cli</span> <span class="pl-c1">=</span> require<span class="pl-kos">(</span><span class="pl-s">'./../../shared/app/Cli'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-smi">Cli</span> <span class="pl-c1">=</span> <span class="pl-s1">cli</span><span class="pl-kos">.</span><span class="pl-c1">Cli</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Sails</span><span class="pl-kos">{</span>

<span class="pl-kos">}</span></pre></div>
<p dir="auto">Because Cli also imports the same defLoader.d.ts, I get the following errors:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="../../shared/app/lib/def/JQuery.d.ts(23,5): error TS2300: Duplicate identifier 'accepts'.
../../shared/app/lib/def/JQuery.d.ts(24,5): error TS2300: Duplicate identifier 'async'.
../../shared/app/lib/def/JQuery.d.ts(26,5): error TS2300: Duplicate identifier 'cache'.
../../shared/app/lib/def/JQuery.d.ts(28,5): error TS2300: Duplicate identifier 'contents'.
../../shared/app/lib/def/JQuery.d.ts(31,5): error TS2300: Duplicate identifier 'contentType'.
../../shared/app/lib/def/JQuery.d.ts(32,5): error TS2300: Duplicate identifier 'context'."><pre class="notranslate"><code class="notranslate">../../shared/app/lib/def/JQuery.d.ts(23,5): error TS2300: Duplicate identifier 'accepts'.
../../shared/app/lib/def/JQuery.d.ts(24,5): error TS2300: Duplicate identifier 'async'.
../../shared/app/lib/def/JQuery.d.ts(26,5): error TS2300: Duplicate identifier 'cache'.
../../shared/app/lib/def/JQuery.d.ts(28,5): error TS2300: Duplicate identifier 'contents'.
../../shared/app/lib/def/JQuery.d.ts(31,5): error TS2300: Duplicate identifier 'contentType'.
../../shared/app/lib/def/JQuery.d.ts(32,5): error TS2300: Duplicate identifier 'context'.
</code></pre></div>
<p dir="auto"><em>(much more errors but I guess you get what's the issue)</em></p>
<p dir="auto">I can solve it two ways, either by removing the Cli reference (so, I don't <code class="notranslate">require</code> the file), or by removing the <code class="notranslate">//&lt;reference path</code> at the top of the file.</p>
<p dir="auto">I didn't have this problem in TS 1.0.</p>
<p dir="auto">Weird thing, I have this issue only here, even if in some other files I do the same, I don't get the error there and I'm not able to understand why it works there while here it fails.</p>
<p dir="auto">But I just figured it out while writing this issue. It is because of the <strong>path</strong> used to load my Cli module, I used <code class="notranslate">require('./../../shared/app/Cli');</code> while I should have used <code class="notranslate">require('./Cli');</code> and because of this somehow the compiler tried to perform the reference twice because it thought it was another file. Well, I didn't have this issue in TS 1.0, I don't know if it's on purpose, anyway my issue is solved now, just wanted to give you a feedback.</p>
<p dir="auto">Keep up the good work, looking forward for TS 2.0!</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)</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="// A self-contained demonstration of the problem follows...
"><pre class="notranslate"><span class="pl-c">// A self-contained demonstration of the problem follows...</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto"><strong>Actual behavior:</strong></p>