<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<h3 dir="auto">Mixin method declaration becomes <code class="notranslate">undefined</code></h3>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Activatable Mixin
class Activatable {
    isActive: boolean;
    activate() {
        this.isActive = true;
    }
    deactivate() {
        this.isActive = false;
    }
}

class SmartObject implements Activatable {
    constructor() {
       
    }

    interact() {
        this.activate();
    }

    // Activatable
    isActive: boolean = false;
    activate: () =&gt; void;
    deactivate: () =&gt; void;
}
applyMixins(SmartObject, [Activatable]);

let smartObj = new SmartObject();
setTimeout(() =&gt; smartObj.interact(), 1000);

// Error: activate is not a method

////////////////////////////////////////
// In your runtime library somewhere
////////////////////////////////////////

function applyMixins(derivedCtor: any, baseCtors: any[]) {
    baseCtors.forEach(baseCtor =&gt; {
        Object.getOwnPropertyNames(baseCtor.prototype).forEach(name =&gt; {
            Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
        });
    });
}
"><pre class="notranslate"><span class="pl-c">// Activatable Mixin</span>
<span class="pl-k">class</span> <span class="pl-v">Activatable</span> <span class="pl-kos">{</span>
    <span class="pl-c1">isActive</span>: <span class="pl-c1">boolean</span><span class="pl-kos">;</span>
    <span class="pl-en">activate</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">isActive</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-en">deactivate</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">isActive</span> <span class="pl-c1">=</span> <span class="pl-c1">false</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-v">SmartObject</span> <span class="pl-s1">implements</span> <span class="pl-v">Activatable</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-kos">}</span>

    <span class="pl-en">interact</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-en">activate</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">// Activatable</span>
    <span class="pl-c1">isActive</span>: <span class="pl-c1">boolean</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
    <span class="pl-c1">activate</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-k">void</span><span class="pl-kos">;</span>
    <span class="pl-c1">deactivate</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-k">void</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">applyMixins</span><span class="pl-kos">(</span><span class="pl-v">SmartObject</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-v">Activatable</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> <span class="pl-s1">smartObj</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">SmartObject</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">smartObj</span><span class="pl-kos">.</span><span class="pl-en">interact</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// Error: activate is not a method</span>

<span class="pl-c">////////////////////////////////////////</span>
<span class="pl-c">// In your runtime library somewhere</span>
<span class="pl-c">////////////////////////////////////////</span>

<span class="pl-k">function</span> <span class="pl-en">applyMixins</span><span class="pl-kos">(</span><span class="pl-s1">derivedCtor</span>: <span class="pl-s1">any</span><span class="pl-kos">,</span> <span class="pl-s1">baseCtors</span>: <span class="pl-s1">any</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">baseCtors</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-s1">baseCtor</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyNames</span><span class="pl-kos">(</span><span class="pl-s1">baseCtor</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-s1">name</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
            <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">derivedCtor</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptor</span><span class="pl-kos">(</span><span class="pl-s1">baseCtor</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s1">name</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-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
A clear and concise description of what you expected to happen (or code).</p>
<p dir="auto"><strong>Babel Configuration (.babelrc)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;presets&quot;: [
        &quot;@babel/preset-typescript&quot;,
        [
            &quot;@babel/preset-env&quot;,
            {
                &quot;modules&quot;: false,
                &quot;targets&quot;: {
                    &quot;browsers&quot;: [
                        &quot;&gt; 1%&quot;,
                        &quot;last 2 versions&quot;,
                        &quot;ie &gt;= 10&quot;
                    ]
                }
            }
        ],
        &quot;@babel/preset-react&quot;,
    ],
    &quot;plugins&quot;: [
        &quot;react-hot-loader/babel&quot;,
        &quot;react-require&quot;,
        &quot;@babel/plugin-proposal-object-rest-spread&quot;,
        [
            &quot;@babel/plugin-proposal-decorators&quot;,
            {
                &quot;legacy&quot;: true
            }
        ],
        [
            &quot;@babel/plugin-proposal-class-properties&quot;,
            {
                &quot;loose&quot;: true
            }
        ],
        &quot;react-html-attrs&quot;,
        &quot;jsx-control-statements&quot;,
        [
            &quot;@babel/plugin-transform-runtime&quot;,
            {
                &quot;corejs&quot;: 2
            }
        ],
        &quot;@babel/plugin-syntax-dynamic-import&quot;,
        &quot;@babel/plugin-syntax-import-meta&quot;,
        &quot;@babel/plugin-proposal-json-strings&quot;,
        &quot;@babel/plugin-proposal-function-sent&quot;,
        &quot;@babel/plugin-proposal-export-namespace-from&quot;,
        &quot;@babel/plugin-proposal-numeric-separator&quot;,
        &quot;@babel/plugin-proposal-throw-expressions&quot;,
        &quot;@babel/plugin-proposal-export-default-from&quot;,
        &quot;@babel/plugin-proposal-logical-assignment-operators&quot;,
        &quot;@babel/plugin-proposal-optional-chaining&quot;,
        [
            &quot;@babel/plugin-proposal-pipeline-operator&quot;,
            {
                &quot;proposal&quot;: &quot;minimal&quot;
            }
        ],
        &quot;@babel/plugin-proposal-nullish-coalescing-operator&quot;,
        &quot;@babel/plugin-proposal-do-expressions&quot;,
        &quot;@babel/plugin-proposal-function-bind&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/preset-typescript"</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-s">"@babel/preset-env"</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"modules"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
                <span class="pl-s">"targets"</span>: <span class="pl-kos">{</span>
                    <span class="pl-s">"browsers"</span>: <span class="pl-kos">[</span>
                        <span class="pl-s">"&gt; 1%"</span><span class="pl-kos">,</span>
                        <span class="pl-s">"last 2 versions"</span><span class="pl-kos">,</span>
                        <span class="pl-s">"ie &gt;= 10"</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-s">"@babel/preset-react"</span><span class="pl-kos">,</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">"react-hot-loader/babel"</span><span class="pl-kos">,</span>
        <span class="pl-s">"react-require"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-object-rest-spread"</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-s">"@babel/plugin-proposal-decorators"</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"legacy"</span>: <span class="pl-c1">true</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-s">"@babel/plugin-proposal-class-properties"</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"loose"</span>: <span class="pl-c1">true</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-s">"react-html-attrs"</span><span class="pl-kos">,</span>
        <span class="pl-s">"jsx-control-statements"</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-s">"@babel/plugin-transform-runtime"</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"corejs"</span>: <span class="pl-c1">2</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-syntax-dynamic-import"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-syntax-import-meta"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-json-strings"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-function-sent"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-export-namespace-from"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-numeric-separator"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-throw-expressions"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-export-default-from"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-logical-assignment-operators"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-optional-chaining"</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-s">"@babel/plugin-proposal-pipeline-operator"</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"proposal"</span>: <span class="pl-s">"minimal"</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-nullish-coalescing-operator"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-do-expressions"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-function-bind"</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):</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="        &quot;@babel/core&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-decorators&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-do-expressions&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-export-default-from&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-export-namespace-from&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-function-bind&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-function-sent&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-json-strings&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-logical-assignment-operators&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-nullish-coalescing-operator&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-numeric-separator&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-object-rest-spread&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-optional-chaining&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-pipeline-operator&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-proposal-throw-expressions&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-syntax-dynamic-import&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-syntax-import-meta&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/plugin-transform-runtime&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/preset-env&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/preset-react&quot;: &quot;^7.0.0&quot;,
        &quot;@babel/preset-typescript&quot;: &quot;^7.3.3&quot;,"><pre class="notranslate"><code class="notranslate">        "@babel/core": "^7.0.0",
        "@babel/plugin-proposal-class-properties": "^7.0.0",
        "@babel/plugin-proposal-decorators": "^7.0.0",
        "@babel/plugin-proposal-do-expressions": "^7.0.0",
        "@babel/plugin-proposal-export-default-from": "^7.0.0",
        "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
        "@babel/plugin-proposal-function-bind": "^7.0.0",
        "@babel/plugin-proposal-function-sent": "^7.0.0",
        "@babel/plugin-proposal-json-strings": "^7.0.0",
        "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
        "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
        "@babel/plugin-proposal-numeric-separator": "^7.0.0",
        "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
        "@babel/plugin-proposal-optional-chaining": "^7.0.0",
        "@babel/plugin-proposal-pipeline-operator": "^7.0.0",
        "@babel/plugin-proposal-throw-expressions": "^7.0.0",
        "@babel/plugin-syntax-dynamic-import": "^7.0.0",
        "@babel/plugin-syntax-import-meta": "^7.0.0",
        "@babel/plugin-transform-runtime": "^7.0.0",
        "@babel/preset-env": "^7.0.0",
        "@babel/preset-react": "^7.0.0",
        "@babel/preset-typescript": "^7.3.3",
</code></pre></div>
<ul dir="auto">
<li>Node/npm version: [Node 10.14.1/npm 6.4.1]</li>
<li>OS: OSX 10.12.5</li>
<li>Monorepo: no</li>
<li>How you are using Babel: <code class="notranslate">loader</code></li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>
<p dir="auto">remove all the declaration, not only the types</p>
<p dir="auto"><strong>Additional context/Screenshots</strong></p>
<p dir="auto">compile typescript using babel-loader :</p>
<p dir="auto">SmartObject</p>
<ul dir="auto">
<li>activate: undefind</li>
<li>deactivate: undefind</li>
<li><strong>proto</strong>
<ul dir="auto">
<li>activate()</li>
<li>deactivate()</li>
</ul>
</li>
</ul>
<p dir="auto">compile typescript using ts-loader :</p>
<p dir="auto">SmartObject</p>
<ul dir="auto">
<li><strong>proto</strong>
<ul dir="auto">
<li>activate()</li>
<li>deactivate()</li>
</ul>
</li>
</ul>
<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>