title: Why protected members can be overridden by public members in TypeScript?
body: <p>I am new to Typescript, and I tried to played around a little with TypeScript in this <a href="http://www.typescriptlang.org/play/" rel="nofollow noreferrer">playground</a>. I noticed that in TypeScript, a protected member in base class can be overridden by public members:</p>
  
  <pre><code>class Base {
      protected name: string = '!'
  }
  
  class Derived extends Base{
      public name: string = '?'
  }
  </code></pre>
  
  <p>On the one hand, this makes sense to me since the Liskov Substitution Principle still holds: base class has stricter requirements than derived class. But on the other hand, I noticed that private member cannot be overridden by protected or public one, which seems inconsistent to me:</p>
  
  <pre><code>class Base {
      private name: string = '!'
  }
  
  class Derived extends Base{
      public name: string = '?'  // ERROR!
  }
  </code></pre>
  
  <p>Thus I wonder:</p>
  
  <ol>
  <li><p>Is my observation an intended behavior or a bug in Typescript?</p></li>
  <li><p>If it's intended, why this inconsistency exists? Why not TypeScript requires all overriding members having the same accessibility as members in base class? Or allowing all derived members with higher accessibility overriding members in base class?</p></li>
  </ol>