<p dir="auto">Hello Typescript!</p>
<p dir="auto">In our typescript file, we have the following function implementation:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="protected foo&lt;A,B&gt;(): {a: A; b: B;}[] {
  return null;
}"><pre class="notranslate"><span class="pl-s1">protected</span> <span class="pl-s1">foo</span><span class="pl-c1">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">,</span><span class="pl-smi">B</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-kos">{</span><span class="pl-c1">a</span>: <span class="pl-smi">A</span><span class="pl-kos">;</span> <span class="pl-c1">b</span>: <span class="pl-smi">B</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>
  return <span class="pl-s1">null</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">When the compiler runs, it throws the following errors<br>
Return type of public method from exported class has or is using private name 'A'.<br>
Return type of public method from exported class has or is using private name 'B'.</p>
<p dir="auto">Is this expected or is this a bug?  My first instinct is that A/B are not private and thus should not have this error be thrown.</p>
<p dir="auto">Note that if protected is changed to public, the error doesn't appear.</p>
<p dir="auto">The following code fails in TypeScript 1.4 with the below errors:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export class MyClass {
    protected myMethod&lt;T&gt;(val: T): T {
        return val;
    }
}"><pre class="notranslate"><code class="notranslate">export class MyClass {
    protected myMethod&lt;T&gt;(val: T): T {
        return val;
    }
}
</code></pre></div>
<p dir="auto">Parameter 'val' of public method from exported class has or is using private name 'T'.<br>
Return type of public method from exported class has or is using private name 'T'.</p>