title: TypeScript - Change property type in child, is it possible?
body: <p>I have a class <code>Manager</code>:</p>
  
  <pre><code>class Manager{
      /**
       * Elements that are managed by the manager.
       */
      private _elements: PIXI.DisplayObject[];
  </code></pre>
  
  <p>and a class <code>TextureManager</code> which extends the <code>Manager</code>:</p>
  
  <pre><code>export class TextureManager extends Game.Managers.Manager{
      private _elements: PIXI.DisplayObjectContainer[];
  }
  </code></pre>
  
  <p>Just so you know, <code>PIXI.DisplayObjectContainer</code> extends <code>PIXI.DisplayObject</code>.</p>
  
  <p>I believe that because it is the same type <em>(based on the same object: <code>PIXI.DisplayObject</code>)</em>, the type change should be possible. (at least it is in real OOP languages, like Java, <em>if I remember correctly</em>)</p>
  
  <p>But I get this error message during the compilation. How should I do?</p>
  
  <blockquote>
    <p>TextureManager.ts(9,18): error TS2416: Class 'TextureManager' incorrectly extends base class 'Manager':<br>
    Types have separate declarations of a private property '_elements'.</p>
  </blockquote>
  
  <p><strong>Solution:</strong></p>
  
  <p>It may seem like a simple solution, but TS <code>1.3</code> has just been released like 3 days ago and add support for the -really wanted- <code>protected</code> attribute. And it seem to work with a <code>protected</code> attribute it does work fine to change the type, I just set <code>protected _elements: any;</code> on the <code>Manager</code> parent class and customize the type as I want in any child <code>protected _elements: Game.Core.Texture;</code>. Pretty cool.</p>
  
  <p>I just get red everywhere since my IDE (WebStorm) hasn't released a support for TS 1.3, but by checking <code>Trigger watcher regardless of syntax error</code> in the <code>File watcher</code> I was able to make it work. Support coming soon: <a href="https://youtrack.jetbrains.com/issue/WEB-14149">https://youtrack.jetbrains.com/issue/WEB-14149</a></p>