<p dir="auto">Currently only variables and modules which conflict with aliases give errors, for example</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module A {
export var AAA: {VarInt;}
export interface AAA { IntInt; }
}

module MyModule {
  var XXX : { VarExt; } // Highlighted as error - ok
  // module XXX { export var VarExt; } // Also would give an error, but import statement would be highlighted. A little bit inconsisent, but ok
  import XXX = A.AAA;
}"><pre class="notranslate"><code class="notranslate">module A {
export var AAA: {VarInt;}
export interface AAA { IntInt; }
}

module MyModule {
  var XXX : { VarExt; } // Highlighted as error - ok
  // module XXX { export var VarExt; } // Also would give an error, but import statement would be highlighted. A little bit inconsisent, but ok
  import XXX = A.AAA;
}
</code></pre></div>
<p dir="auto">At the same time, interfaces, classes, enums and functions would not produce an error. Instead, import aliases with a same name would be silently ignored, resulting in WTF errors later in the code.</p>
<p dir="auto">For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module A {
  export var AAA: {VarInt;}
  export interface AAA { IntInt; }
}

module MyModuleWithFunction {
  function XXX() {}
  import XXX = A.AAA;
  XXX.VarInt; // WTF error
  XXX.arguments; // No error
}

module MyModuleWithClass {
  class XXX { static VarDup; IntDup;}
  import XXX = A.AAA;
  XXX.VarInt; // WTF error
  XXX.VarDup; // No error
  var i: XXX;
  i.IntInt; // WTF error
  i.IntDup; // No error
}"><pre class="notranslate"><code class="notranslate">module A {
  export var AAA: {VarInt;}
  export interface AAA { IntInt; }
}

module MyModuleWithFunction {
  function XXX() {}
  import XXX = A.AAA;
  XXX.VarInt; // WTF error
  XXX.arguments; // No error
}

module MyModuleWithClass {
  class XXX { static VarDup; IntDup;}
  import XXX = A.AAA;
  XXX.VarInt; // WTF error
  XXX.VarDup; // No error
  var i: XXX;
  i.IntInt; // WTF error
  i.IntDup; // No error
}
</code></pre></div>
<p dir="auto">IMHO, current behavior of silently ignoring duplicate aliases is confusing and is not described in specifications.</p>
<p dir="auto">I have been having a heck of a time getting es6 promises to work with Typescript in a ASP.NET 5 project. I installed the es6-promise.d.ts via tsd install es6-promise. However, I get errors about Promise being duplicated. When I hover on the Promise declaration in the es6-promise.d.ts file, I get the error below (see the blue section ac the bottom of the image). It seems to be conflicting with some typescript definition file from a Microsoft SDK, which is obviously not part of my project.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/4ff8edec977fea4dacb8690b9e03ec88c518410599a06d5f64387d8af4bbfb0d/687474703a2f2f692e737461636b2e696d6775722e636f6d2f76303950632e706e67"><img src="https://camo.githubusercontent.com/4ff8edec977fea4dacb8690b9e03ec88c518410599a06d5f64387d8af4bbfb0d/687474703a2f2f692e737461636b2e696d6775722e636f6d2f76303950632e706e67" alt="error" data-canonical-src="http://i.stack.imgur.com/v09Pc.png" style="max-width: 100%;"></a></p>
<p dir="auto">Does anyone have an idea on why this might be happening or how I can fix this?</p>