<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//== tests/cases/compiler/conflictingMemberTypesInBases.ts (1 errors) ====
interface A {
    m: string;
}
interface B extends A {
}
interface C {
    m: number;
}
interface D extends C {
}

interface E extends B { } // Error here for extending B and D
//!!! Interface 'E' cannot simultaneously extend types 'B' and 'D':
//!!! Named properties 'm' of types 'B' and 'D' are not identical.
interface E extends D { } // No duplicate error here"><pre class="notranslate"><span class="pl-c">//== tests/cases/compiler/conflictingMemberTypesInBases.ts (1 errors) ====</span>
<span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">m</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">B</span> <span class="pl-k">extends</span> <span class="pl-smi">A</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-kos">{</span>
    <span class="pl-c1">m</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-k">extends</span> <span class="pl-smi">C</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-k">extends</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-c">// Error here for extending B and D</span>
<span class="pl-c">//!!! Interface 'E' cannot simultaneously extend types 'B' and 'D':</span>
<span class="pl-c">//!!! Named properties 'm' of types 'B' and 'D' are not identical.</span>
<span class="pl-k">interface</span> <span class="pl-smi">E</span> <span class="pl-k">extends</span> <span class="pl-smi">D</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-c">// No duplicate error here</span></pre></div>
<p dir="auto">Expected: errors as above<br>
Actual: no errors</p>
<p dir="auto">The early discussions about generics had this feature outlined, but it never made it into the final version for some reason. Meanwhile, it would be extremely helpful in some cases. The use case that it most dear to my heart is Knockout:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="interface Observable&lt;T&gt; {
   &lt;U&gt;( this: U, value: T ): U;
}

var viewModel = {
   Str: ko.observable( &quot;abc&quot; ),
   Num: ko.observable( 5 )
};

viewModel.Str( &quot;xyz&quot; ).Num( 10 );"><pre class="notranslate"><code class="notranslate">interface Observable&lt;T&gt; {
   &lt;U&gt;( this: U, value: T ): U;
}

var viewModel = {
   Str: ko.observable( "abc" ),
   Num: ko.observable( 5 )
};

viewModel.Str( "xyz" ).Num( 10 );
</code></pre></div>