<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
When a class (B) extends another class (A) and includes a type definition to narrow the type of something specified in class A, it will set the narrowed property's value to undefined. This diverges from the TSC behavior.<br>
The output from the below code under babel is <code class="notranslate">a, undefined</code>.<br>
<strong>Input Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  class A {
    value: any
    constructor(value: any) {
      this.value = value
    }
  }

  class B extends A {
    value: string
  }

document.write(`${new A('a').value}, ${new B('b').value}`)"><pre class="notranslate">  <span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">value</span>: <span class="pl-smi">any</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">value</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s1">value</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">extends</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">value</span>: <span class="pl-smi">string</span>
  <span class="pl-kos">}</span>

<span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-k">new</span> <span class="pl-smi">A</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-k">new</span> <span class="pl-smi">B</span><span class="pl-kos">(</span><span class="pl-s">'b'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
The output from the code should be <code class="notranslate">a, b</code>.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">.babelrc:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    &quot;@babel/env&quot;,
    &quot;@babel/typescript&quot;
  ],
  &quot;plugins&quot;: [
    &quot;@babel/proposal-class-properties&quot;,
    &quot;@babel/proposal-object-rest-spread&quot;
  ]
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
    <span class="pl-s">"@babel/env"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/typescript"</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
    <span class="pl-s">"@babel/proposal-class-properties"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/proposal-object-rest-spread"</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.1.6</li>
<li>Node/npm version: Node 10 / NPM 6</li>
<li>OS: Any OS</li>
<li>Monorepo: doesn't matter</li>
<li>How you are using Babel: loader</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
It seems like babel is setting <code class="notranslate">value = undefined</code> in the class property - it needs to check if that value is defined in the parent before overwriting it.</p>
<p dir="auto"><strong>TypeScript Version:</strong>  2.1.1</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class PartialPolicySearchIten {
	public displayValue: string;
	public oriNumber: string;
	public parentName: string;
	public sysNumber: string;
	public systemCode: number;
	public systemName: string;
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">PartialPolicySearchIten</span> <span class="pl-kos">{</span>
	<span class="pl-k">public</span> <span class="pl-c1">displayValue</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
	<span class="pl-k">public</span> <span class="pl-c1">oriNumber</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
	<span class="pl-k">public</span> <span class="pl-c1">parentName</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
	<span class="pl-k">public</span> <span class="pl-c1">sysNumber</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
	<span class="pl-k">public</span> <span class="pl-c1">systemCode</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
	<span class="pl-k">public</span> <span class="pl-c1">systemName</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class PartialPolicySearchIten {
       constructor() {
        this.displayValue = undefined;
	this.oriNumber = undefined;
	this.parentName = undefined;
	this.sysNumber = undefined;
	this.systemCode = undefined;
	this. systemName = undefined;
       }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">PartialPolicySearchIten</span> <span class="pl-kos">{</span>
       <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">displayValue</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span>
	<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">oriNumber</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span>
	<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parentName</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span>
	<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">sysNumber</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span>
	<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">systemCode</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span>
	<span class="pl-smi">this</span><span class="pl-kos">.</span> <span class="pl-c1">systemName</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span>
       <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Actual behavior:</strong><br>
class PartialPolicySearchIten { }</p>
<p dir="auto">The problem comes when using Reflection it can't find the properties. I would expected that the properties exists as i'm redefining them. Otherwise their very little point is declaring properties of a class.</p>