<h3 dir="auto">TL;DR: provide a syntax which kills this compiler error:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Class 'D' incorrectly implements interface 'C'.
Property '_a' is protected but type 'D' is not a class derived from 'C'."><pre class="notranslate"><code class="notranslate">Class 'D' incorrectly implements interface 'C'.
Property '_a' is protected but type 'D' is not a class derived from 'C'.
</code></pre></div>
<p dir="auto">If the implementer wants to take responsibility for making sure the private members behave correctly they should be able to do so.</p>
<p dir="auto">This would allow mixins to have protected members and solve a few issues with other multiple inheritance use-cases.</p>
<h3 dir="auto">Proposal: Allow implementation of protected and private members in derived and implementing classes</h3>
<p dir="auto">Allow interface implementers to implement protected and private methods. This makes it possible for types with private and protected members to be implemented as interfaces (provided the inheritor correctly manages the private state).</p>
<p dir="auto">Suggested syntax:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    class P {private _p;}
    class Q implements P { private _p implements P; }"><pre class="notranslate">    <span class="pl-k">class</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span><span class="pl-k">private</span> <span class="pl-c1">_p</span><span class="pl-kos">;</span><span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">Q</span> <span class="pl-k">implements</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span> <span class="pl-k">private</span> <span class="pl-c1">_p</span> <span class="pl-s1">implements</span> <span class="pl-smi">P</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div>
<p dir="auto">Since name mangling is not used we can't alias the private members, so if implementing more than one interface with private members, the private members must either have different names, or the underlying uses of the members must be compatible, or be made compatible.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    class P{private _p;}
    class P2{private _p;}
    class Q implements P, P2{ private _p implements P, P2;}"><pre class="notranslate">    <span class="pl-k">class</span> <span class="pl-smi">P</span><span class="pl-kos">{</span><span class="pl-k">private</span> <span class="pl-c1">_p</span><span class="pl-kos">;</span><span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">P2</span><span class="pl-kos">{</span><span class="pl-k">private</span> <span class="pl-c1">_p</span><span class="pl-kos">;</span><span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">Q</span> <span class="pl-k">implements</span> <span class="pl-smi">P</span><span class="pl-kos">,</span> <span class="pl-smi">P2</span><span class="pl-kos">{</span> <span class="pl-k">private</span> <span class="pl-c1">_p</span> <span class="pl-s1">implements</span> <span class="pl-smi">P</span><span class="pl-kos">,</span> <span class="pl-c1">P2</span><span class="pl-kos">;</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">Of course interfaces can have protected and private members, though they can't declare them directly and you can't implement them directly:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    class P { protected _p = &quot;p&quot;; }
    interface Q extends P { q; };
    // Q can't be implemented except by a class derived from P
    class PX extends P implements Q { q = &quot;q&quot;; }
    class R { protected _r = &quot;r&quot;; }
    interface S extends Q, R { s; }
    // S cannot be implemented by anyone
    // However you could gin up the correct members, and cast to S
    function SFactory(): S { var px = new PX(); px[&quot;s&quot;] = &quot;s&quot;; px[&quot;_r&quot;] = &quot;r&quot;; return &lt;S&gt;px; }
    // you can even make it constructable:
    class _S extends PX {
        s = &quot;s&quot;;
        protected _r = &quot;r&quot;;
    }

    var S: new (...args) =&gt; S = &lt;new (...args) =&gt; S&gt;&lt;new()=&gt; any&gt;_S;
    var myS = new S();"><pre class="notranslate">    <span class="pl-k">class</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span> <span class="pl-k">protected</span> <span class="pl-c1">_p</span> <span class="pl-c1">=</span> <span class="pl-s">"p"</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-k">interface</span> <span class="pl-smi">Q</span> <span class="pl-k">extends</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span> <span class="pl-c1">q</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-c">// Q can't be implemented except by a class derived from P</span>
    <span class="pl-k">class</span> <span class="pl-smi">PX</span> <span class="pl-k">extends</span> <span class="pl-smi">P</span> <span class="pl-k">implements</span> <span class="pl-smi">Q</span> <span class="pl-kos">{</span> <span class="pl-c1">q</span> <span class="pl-c1">=</span> <span class="pl-s">"q"</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">R</span> <span class="pl-kos">{</span> <span class="pl-k">protected</span> <span class="pl-c1">_r</span> <span class="pl-c1">=</span> <span class="pl-s">"r"</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-k">interface</span> <span class="pl-smi">S</span> <span class="pl-k">extends</span> <span class="pl-smi">Q</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-kos">{</span> <span class="pl-c1">s</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-c">// S cannot be implemented by anyone</span>
    <span class="pl-c">// However you could gin up the correct members, and cast to S</span>
    <span class="pl-k">function</span> <span class="pl-smi">SFactory</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">S</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">px</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">PX</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">px</span><span class="pl-kos">[</span><span class="pl-s">"s"</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">"s"</span><span class="pl-kos">;</span> <span class="pl-s1">px</span><span class="pl-kos">[</span><span class="pl-s">"_r"</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">"r"</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-kos">&lt;</span><span class="pl-smi">S</span><span class="pl-kos">&gt;</span><span class="pl-s1">px</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-c">// you can even make it constructable:</span>
    <span class="pl-k">class</span> <span class="pl-smi">_S</span> <span class="pl-k">extends</span> <span class="pl-smi">PX</span> <span class="pl-kos">{</span>
        <span class="pl-c1">s</span> <span class="pl-c1">=</span> <span class="pl-s">"s"</span><span class="pl-kos">;</span>
        <span class="pl-k">protected</span> <span class="pl-c1">_r</span> <span class="pl-c1">=</span> <span class="pl-s">"r"</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">var</span> <span class="pl-smi">S</span>: <span class="pl-k">new</span> <span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">S</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-k">new</span> <span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">S</span><span class="pl-kos">&gt;</span><span class="pl-kos">&lt;</span><span class="pl-k">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span> <span class="pl-smi">any</span><span class="pl-kos">&gt;</span><span class="pl-c1">_S</span><span class="pl-kos">;</span>
    <span class="pl-k">var</span> <span class="pl-s1">myS</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">S</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I understand the explanation given in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40483812" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/471" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/471/hovercard" href="https://github.com/microsoft/TypeScript/issues/471">#471</a>, that we cannot simply ignore the private members, as e.g. other instances of B need to be able to access B's private members on C. However protected members are part of the API contract too, for inheritors, and we should be able to implement them.</p>
<p dir="auto">What's more, nothing is truly private in JavaScript. This can be achieved in typescript using the <code class="notranslate">["_p"]</code> escape hatch and an intermediate class as above.</p>
<h3 dir="auto">Motivation</h3>
<p dir="auto">Several uses for this. One is that it seems to be the only way to allow mixins to have private or protected members.</p>
<p dir="auto">I'm working with a large library, and have come across the following situation, where I need a type which implements two classes/interfaces which derive from a common base.</p>
<p dir="auto">Given these classes:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    interface A { a; }
    class B implements A {
        protected _a; get a() { return this._a; }
        BFunc() { };
    }
    class C implements A {
        protected _a; get a() { return this._a; }
        CFunc() { };
    }"><pre class="notranslate">    <span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">B</span> <span class="pl-k">implements</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
        <span class="pl-k">protected</span> <span class="pl-c1">_a</span><span class="pl-kos">;</span> <span class="pl-k">get</span> <span class="pl-en">a</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_a</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
        <span class="pl-en">BFunc</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">C</span> <span class="pl-k">implements</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
        <span class="pl-k">protected</span> <span class="pl-c1">_a</span><span class="pl-kos">;</span> <span class="pl-k">get</span> <span class="pl-en">a</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_a</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
        <span class="pl-en">CFunc</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span></pre></div>
<p dir="auto">I need then to create a class implementing both <code class="notranslate">B</code> and <code class="notranslate">C</code>. Note that both <code class="notranslate">B</code> and <code class="notranslate">C</code> have chosen to implement <code class="notranslate">a</code> using a protected backing member <code class="notranslate">_a</code>, and that these are compatible implementations with exactly the same meaning. There is now no way to achieve this.</p>
<p dir="auto">Allowing interfaces to declare protected members would make them part of the API contract for inheritors and would solve this problem.</p>
<p dir="auto">This does not work:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    // Class 'D' incorrectly implements interface 'C'.
    // Property '_a' is protected but type 'B' is not a class derived from 'C'.
    class D extends B implements C {
        CFunc() { };
    }"><pre class="notranslate">    <span class="pl-c">// Class 'D' incorrectly implements interface 'C'.</span>
    <span class="pl-c">// Property '_a' is protected but type 'B' is not a class derived from 'C'.</span>
    <span class="pl-k">class</span> <span class="pl-smi">D</span> <span class="pl-k">extends</span> <span class="pl-smi">B</span> <span class="pl-k">implements</span> <span class="pl-smi">C</span> <span class="pl-kos">{</span>
        <span class="pl-en">CFunc</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span></pre></div>
<p dir="auto">Neither does this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    // Class 'E' incorrectly implements interface 'B'.
    // Property '_a' is protected but type 'E' is not a class derived from 'B'.
    // Class 'E' incorrectly implements interface 'C'.
    // Property '_a' is protected but type 'E' is not a class derived from 'C'.   
    class E implements B, C {
        _a;
        get a() { return this._a; }
        BFunc() { };
        CFunc() { };
    }"><pre class="notranslate">    <span class="pl-c">// Class 'E' incorrectly implements interface 'B'.</span>
    <span class="pl-c">// Property '_a' is protected but type 'E' is not a class derived from 'B'.</span>
    <span class="pl-c">// Class 'E' incorrectly implements interface 'C'.</span>
    <span class="pl-c">// Property '_a' is protected but type 'E' is not a class derived from 'C'.   </span>
    <span class="pl-k">class</span> <span class="pl-smi">E</span> <span class="pl-k">implements</span> <span class="pl-smi">B</span><span class="pl-kos">,</span> <span class="pl-smi">C</span> <span class="pl-kos">{</span>
        <span class="pl-c1">_a</span><span class="pl-kos">;</span>
        <span class="pl-k">get</span> <span class="pl-en">a</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_a</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
        <span class="pl-en">BFunc</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
        <span class="pl-en">CFunc</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span></pre></div>
<p dir="auto">For example if I could reopen the interface like so:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    interface A { protected _a;}"><pre class="notranslate">    <span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-k">protected</span> <span class="pl-c1">_a</span><span class="pl-kos">;</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">That would solve the issue. By declaring it part of the API contract, albeit one only accessible to inheritors, we solve the problem.</p>
<p dir="auto">Currently the only way to work around involves making the backing member public in the interface, or public in the derived classes. (There has to be a backing member in this case). Even making the <code class="notranslate">A</code> a class, and declaring the protected member won't allow you to do it.</p>
<p dir="auto">It seems like the rules for <strong>a)</strong> implementing multiple interfaces and <strong>b)</strong> intersection types should be consistent.</p>
<p dir="auto">Example 1: Optional members</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    interface A { m1: string;}
    interface B { m1?: string;}
    // allowed, m1 is required.
    type CT = A&amp;B;
    var a : CT = {m1:undefined};// allowed, string can be undefined
    // error, m1 is required, 
    //TS2322: Type '{}' is not assignable to type 'A &amp; B', Property 'm1' is missing in type '{}'.
    var b : CT = {};

    // not allowed, TS2320, Named property 'm1' of types 'A' and 'B' are not identical.
    interface C extends A, B {}"><pre class="notranslate">    <span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span> <span class="pl-c1">m1</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-kos">{</span> <span class="pl-c1">m1</span>?: <span class="pl-smi">string</span><span class="pl-kos">;</span><span class="pl-kos">}</span>
    <span class="pl-c">// allowed, m1 is required.</span>
    <span class="pl-k">type</span> <span class="pl-smi">CT</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span><span class="pl-c1">&amp;</span><span class="pl-smi">B</span><span class="pl-kos">;</span>
    <span class="pl-k">var</span> <span class="pl-s1">a</span> : <span class="pl-smi">CT</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">m1</span>:<span class="pl-c1">undefined</span><span class="pl-kos">}</span><span class="pl-kos">;</span><span class="pl-c">// allowed, string can be undefined</span>
    <span class="pl-c">// error, m1 is required, </span>
    <span class="pl-c">//TS2322: Type '{}' is not assignable to type 'A &amp; B', Property 'm1' is missing in type '{}'.</span>
    <span class="pl-k">var</span> <span class="pl-s1">b</span> : <span class="pl-smi">CT</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

    <span class="pl-c">// not allowed, TS2320, Named property 'm1' of types 'A' and 'B' are not identical.</span>
    <span class="pl-k">interface</span> <span class="pl-smi">C</span> <span class="pl-k">extends</span> <span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">Example 2: Protected members</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    class P { protected m1: number; }
    class Q { m1: number; }
    // allowed, m1 is public
    type PQT = P&amp;Q;
    var p : PQT = &lt;PQT&gt;{m1:undefined};
    p.m1; // allowed, m1 is public in PQT

    // not allowed
    // TS2420: Class 'PQ' incorrectly implements interface 'Q'
    // Property 'm1' is protected in type 'PQ' but public in type 'Q'.
    class PQ extends P implements Q {}
    // TS2420: Class 'QP' incorrectly implements interface 'P'.
    // Property 'm1' is protected but type 'Q' is not a class derived from 'P'.
    class QP extends Q implements P {}

    // Allowed to relax protection explicitly in a derived class
    class PQX extends P implements Q { m1: number;}

    // Not allowed - again, seems a bug.
    class QPX extends Q implements P { m1: number;}

    // Workaround is to use an intermediate class to relax the protection
    class PX extends P {m1: number;}
    class QPX2 extends Q implements PX { m1: number;}"><pre class="notranslate">    <span class="pl-k">class</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span> <span class="pl-k">protected</span> <span class="pl-c1">m1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">Q</span> <span class="pl-kos">{</span> <span class="pl-c1">m1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
    <span class="pl-c">// allowed, m1 is public</span>
    <span class="pl-k">type</span> <span class="pl-smi">PQT</span> <span class="pl-c1">=</span> <span class="pl-smi">P</span><span class="pl-c1">&amp;</span><span class="pl-smi">Q</span><span class="pl-kos">;</span>
    <span class="pl-k">var</span> <span class="pl-s1">p</span> : <span class="pl-smi">PQT</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">PQT</span><span class="pl-kos">&gt;</span><span class="pl-kos">{</span><span class="pl-c1">m1</span>:<span class="pl-c1">undefined</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-s1">p</span><span class="pl-kos">.</span><span class="pl-c1">m1</span><span class="pl-kos">;</span> <span class="pl-c">// allowed, m1 is public in PQT</span>

    <span class="pl-c">// not allowed</span>
    <span class="pl-c">// TS2420: Class 'PQ' incorrectly implements interface 'Q'</span>
    <span class="pl-c">// Property 'm1' is protected in type 'PQ' but public in type 'Q'.</span>
    <span class="pl-k">class</span> <span class="pl-smi">PQ</span> <span class="pl-k">extends</span> <span class="pl-smi">P</span> <span class="pl-k">implements</span> <span class="pl-smi">Q</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
    <span class="pl-c">// TS2420: Class 'QP' incorrectly implements interface 'P'.</span>
    <span class="pl-c">// Property 'm1' is protected but type 'Q' is not a class derived from 'P'.</span>
    <span class="pl-k">class</span> <span class="pl-smi">QP</span> <span class="pl-k">extends</span> <span class="pl-smi">Q</span> <span class="pl-k">implements</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

    <span class="pl-c">// Allowed to relax protection explicitly in a derived class</span>
    <span class="pl-k">class</span> <span class="pl-smi">PQX</span> <span class="pl-k">extends</span> <span class="pl-smi">P</span> <span class="pl-k">implements</span> <span class="pl-smi">Q</span> <span class="pl-kos">{</span> <span class="pl-c1">m1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span><span class="pl-kos">}</span>

    <span class="pl-c">// Not allowed - again, seems a bug.</span>
    <span class="pl-k">class</span> <span class="pl-smi">QPX</span> <span class="pl-k">extends</span> <span class="pl-smi">Q</span> <span class="pl-k">implements</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span> <span class="pl-c1">m1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span><span class="pl-kos">}</span>

    <span class="pl-c">// Workaround is to use an intermediate class to relax the protection</span>
    <span class="pl-k">class</span> <span class="pl-smi">PX</span> <span class="pl-k">extends</span> <span class="pl-smi">P</span> <span class="pl-kos">{</span><span class="pl-c1">m1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span><span class="pl-kos">}</span>
    <span class="pl-k">class</span> <span class="pl-smi">QPX2</span> <span class="pl-k">extends</span> <span class="pl-smi">Q</span> <span class="pl-k">implements</span> <span class="pl-smi">PX</span> <span class="pl-kos">{</span> <span class="pl-c1">m1</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span><span class="pl-kos">}</span></pre></div>
<ol dir="auto">
<li>Implementing multiple interfaces should create a type which is the intersection of the types of the interfaces (but with any new members added).</li>
<li>It should not be an error to make an optional member non-optional in a derived class. Non-optional members can be undefined, so nothing should break. This is consistent with intersection types. (Arguably also vice versa.)</li>
<li>It should not be an error to relax the protected or private status of a member in a derived or implementing class, consistent with intersection types. (in 1.6 you can do it in a derived class but not an implementing class). Or at any rate it should be possible to do so if you need to. See also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="94986425" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/3854" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/3854/hovercard" href="https://github.com/microsoft/TypeScript/issues/3854">#3854</a><br>
(Surely from a strict point of view Q above is a subtype of P, because it can be used wherever P is used. All members visible externally on P are visible externally on Q, and all members visible internally on P are visible internally on Q. So I think that makes Q a subtype of P.)</li>
</ol>
<p dir="auto">Implementing two or more interfaces should create the same type as the intersection of the types. That they don't seems like a bug.</p>
<p dir="auto">In pseudocode, this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    interface C extends A, B {}"><pre class="notranslate">    <span class="pl-k">interface</span> <span class="pl-smi">C</span> <span class="pl-k">extends</span> <span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">Should be identical in effect to this (if it was a thing):</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    type C1 = A &amp; B;
    interface C extends C1 {}"><pre class="notranslate">    <span class="pl-k">type</span> <span class="pl-smi">C1</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">B</span><span class="pl-kos">;</span>
    <span class="pl-k">interface</span> <span class="pl-smi">C</span> <span class="pl-k">extends</span> <span class="pl-smi">C1</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>