<p dir="auto">systemjs when there are duplicate dependence in system.register entry,<br>
the problem occur because the below systemjs function</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function dedupe(deps) {
  var newDeps = [];
  for (var i = 0, l = deps.length; i &lt; l; i++)
    if (indexOf.call(newDeps, deps[i]) == -1)
      newDeps.push(deps[i])
  return newDeps;
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">dedupe</span><span class="pl-kos">(</span><span class="pl-s1">deps</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">var</span> <span class="pl-s1">newDeps</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">l</span> <span class="pl-c1">=</span> <span class="pl-s1">deps</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">l</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">indexOf</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s1">newDeps</span><span class="pl-kos">,</span> <span class="pl-s1">deps</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c1">==</span> <span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-kos">)</span>
      <span class="pl-s1">newDeps</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">deps</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
  <span class="pl-k">return</span> <span class="pl-s1">newDeps</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">They really delete dumplicate dependence, and the system.register <code class="notranslate">dependence</code> array length can't match the <code class="notranslate">setter</code> array then I see a lot of red in my console... ...</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="86652142" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/3444" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/3444/hovercard?comment_id=113298972&amp;comment_type=issue_comment" href="https://github.com/microsoft/TypeScript/issues/3444#issuecomment-113298972">#3444 (comment)</a></p>
<p dir="auto">fix solution in my local <a href="https://github.com/xsilen/TypeScript/commit/751fde222f2973acb04067b95a04daf773974742?diff=unified">https://github.com/xsilen/TypeScript/commit/751fde222f2973acb04067b95a04daf773974742?diff=unified</a></p>
<p dir="auto">An alternative to <code class="notranslate">extends</code> that is mostly identical but with the following variation: instead of erroring when properties are re-declared with different types, it would resolve to the type unions instead (properties having a function type are already overloaded in inheritance, so there's no need to address them):</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface A {
    x: boolean;
}

interface B extends A { // Error! Incorrectly extends A. Types of x are incompatible.
    x: number;
}

interface C overloads A { // OK! x is now of type boolean | number
    x: number;
}

interface D overloads A { // OK! x is now of type boolean | number | string
    x: number | string;
}

interface E overloads A { // OK! x is now of type boolean | (param: number): string
    x(param: number): string;
}"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">x</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">interface</span> <span class="pl-smi">B</span> <span class="pl-k">extends</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-c">// Error! Incorrectly extends A. Types of x are incompatible.</span>
    <span class="pl-c1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">interface</span> <span class="pl-smi">C</span> <span class="pl-s1">overloads</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-c">// OK! x is now of type boolean | number</span>
    <span class="pl-c1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">interface</span> <span class="pl-smi">D</span> <span class="pl-s1">overloads</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-c">// OK! x is now of type boolean | number | string</span>
    <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">interface</span> <span class="pl-smi">E</span> <span class="pl-s1">overloads</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-c">// OK! x is now of type boolean | (param: number): string</span>
    <span class="pl-c1">x</span><span class="pl-kos">(</span><span class="pl-s1">param</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">An operator based on this variation of inheritance would have the property that for any two (object or function) interfaces  <code class="notranslate">A</code>, <code class="notranslate">B</code>,  <code class="notranslate">A overload B</code> (illustrative, not suggested, name) can never fail, even if the operands contain incompatible property types (note: this assumes cycles are ignored in the operator version). In contrast to intersection, it wouldn't even fail if <code class="notranslate">A</code> is an object type and <code class="notranslate">B</code> is a function type, as hybrid object/function types are already allowed by standard inheritance.</p>
<p dir="auto">This an attempt to address the <a href="https://github.com/Microsoft/TypeScript/issues/4278#issuecomment-130240112" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/4278/hovercard">challenge presented by @ahejlsberg</a> of having an inheritance-like operation that is guaranteed not to fail when applied to generic type parameters:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare function combine&lt;T, U&gt;(obj1: T, obj2: U): T overload U;"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">combine</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-smi">U</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">obj1</span>: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-s1">obj2</span>: <span class="pl-smi">U</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span> <span class="pl-s1">overload</span> <span class="pl-smi">U</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">and thus may be used as a replacement to intersection that would be more consistent with the rest of the language (and inheritance logic in particular).</p>
<p dir="auto">Even though I'm not a computer scientist or a language expert I tried to do my best for giving a basic direction (that is, at least a possible idea) on how to solve this. I'm not in a position to be able to see all the details, nuances or problems for integrating something like this into the language.</p>