<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
After updating to <code class="notranslate">babel v7.0.0-beta.53</code> I can't use typescript assignment to class properties like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class A {
  constructor(
    private privateProperty: any,
    protected protectedProperty: any,
    public publicProperty: any,
  ) {
    this.privateProperty; // not set during runtime
    this.protectedProperty; // not set during runtime
    this.publicProperty; // not set during runtime
  }
}

const a = new A('nothing', 'from', 'this will be set');"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span>
    <span class="pl-k">private</span> <span class="pl-s1">privateProperty</span>: <span class="pl-smi">any</span><span class="pl-kos">,</span>
    <span class="pl-k">protected</span> <span class="pl-s1">protectedProperty</span>: <span class="pl-smi">any</span><span class="pl-kos">,</span>
    <span class="pl-k">public</span> <span class="pl-s1">publicProperty</span>: <span class="pl-smi">any</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">privateProperty</span><span class="pl-kos">;</span> <span class="pl-c">// not set during runtime</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">protectedProperty</span><span class="pl-kos">;</span> <span class="pl-c">// not set during runtime</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">publicProperty</span><span class="pl-kos">;</span> <span class="pl-c">// not set during runtime</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">A</span><span class="pl-kos">(</span><span class="pl-s">'nothing'</span><span class="pl-kos">,</span> <span class="pl-s">'from'</span><span class="pl-kos">,</span> <span class="pl-s">'this will be set'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Input Code</strong><br>
Example <a href="https://github.com/Xesenix/xes-typescript-playground/tree/typescript-constructor-example">https://github.com/Xesenix/xes-typescript-playground/tree/typescript-constructor-example</a> run <code class="notranslate">npm run serve</code> in console you will see <code class="notranslate">undefined</code> for the class A property.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class A {
	constructor(
		public property: any,
	) {}
};

const a = new A('test');

console.log('property', a.property); // undefined and i would expect this to be `test`"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
	<span class="pl-en">constructor</span><span class="pl-kos">(</span>
		<span class="pl-k">public</span> <span class="pl-s1">property</span>: <span class="pl-smi">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-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">A</span><span class="pl-kos">(</span><span class="pl-s">'test'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'property'</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-c1">property</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// undefined and i would expect this to be `test`</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
I expect that properties defined via constructor are filed with values feed to the constructor when creating an instance of class.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong><br>
The minimal case is available here <a href="https://github.com/Xesenix/xes-typescript-playground/tree/typescript-constructor-example">https://github.com/Xesenix/xes-typescript-playground/tree/typescript-constructor-example</a></p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version: v7.0.0-beta.53</li>
<li>Node/npm version: 10.4.1</li>
<li>OS: Windows 7</li>
<li>How you are using Babel: webpack-4 loader</li>
</ul>
<p dir="auto">The following doesn't seem to work, but is also not listed in <a href="https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript">the readme</a></p>
<p dir="auto">If it's not possible to fix/implement, it would be good to throw an error when used, and mention it there.</p>
<h3 dir="auto">Input Code</h3>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Foo {
  constructor(public type: string) {
    console.log('type', this.type);
  }
}
new Foo('bar');"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">public</span> <span class="pl-s1">type</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'type'</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">type</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">new</span> <span class="pl-smi">Foo</span><span class="pl-kos">(</span><span class="pl-s">'bar'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    [&quot;@babel/env&quot;, {
      &quot;targets&quot;: {
        &quot;browsers&quot;: [&quot;last 2 versions&quot;],
        &quot;node&quot;: &quot;8&quot;
      }
    }],
    &quot;@babel/preset-stage-3&quot;,
    &quot;@babel/typescript&quot;
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"presets"</span>: [
    [<span class="pl-s"><span class="pl-pds">"</span>@babel/env<span class="pl-pds">"</span></span>, {
      <span class="pl-ent">"targets"</span>: {
        <span class="pl-ent">"browsers"</span>: [<span class="pl-s"><span class="pl-pds">"</span>last 2 versions<span class="pl-pds">"</span></span>],
        <span class="pl-ent">"node"</span>: <span class="pl-s"><span class="pl-pds">"</span>8<span class="pl-pds">"</span></span>
      }
    }],
    <span class="pl-s"><span class="pl-pds">"</span>@babel/preset-stage-3<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>@babel/typescript<span class="pl-pds">"</span></span>
  ]
}</pre></div>
<h3 dir="auto">Expected Behavior</h3>
<ul dir="auto">
<li>have <code class="notranslate">this.type = type</code> added as first line in the constructor, or</li>
<li>throw an error that this syntax is not supported (so it won't be used by accident, resulting in incorrect transpiled code)</li>
</ul>
<p dir="auto">TypeScript transpiles to:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var Foo = /** @class */ (function () {
    function Foo(type) {
        this.type = type;
        console.log('type', this.type);
    }
    return Foo;
}());
new Foo('bar');"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-v">Foo</span> <span class="pl-c1">=</span> <span class="pl-c">/** <span class="pl-k">@class</span> */</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">function</span> <span class="pl-v">Foo</span><span class="pl-kos">(</span><span class="pl-s1">type</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">type</span> <span class="pl-c1">=</span> <span class="pl-s1">type</span><span class="pl-kos">;</span>
        <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'type'</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">type</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">return</span> <span class="pl-v">Foo</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-k">new</span> <span class="pl-v">Foo</span><span class="pl-kos">(</span><span class="pl-s">'bar'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Constructor function without any assignment, so the <code class="notranslate">type</code> parameter is never set.</p>
<h3 dir="auto">Context</h3>
<p dir="auto">Wanting to make use of TypeScript type checking, but also (more up-to-date) babel transpilation, without having to do a 2-step-compilation pass. Every unsupported feature should at least be detected with throwing an error, and documented. Without that, people could use that unsupported code by accident without knowing, resulting in non-working code.</p>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>7.0.0-beta.35</td>
</tr>
<tr>
<td>node</td>
<td>8.9.1</td>
</tr>
<tr>
<td>npm</td>
<td>5.5.1 (yarn 1.3.2)</td>
</tr>
<tr>
<td>Operating System</td>
<td>OSX</td>
</tr>
</tbody>
</table>