<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
When using object destruction on function parameter types, babel seems not to understand this syntax. Error keep's saying</p>
<p dir="auto"><code class="notranslate">SyntaxError: /path/to/my/file/inputs.tsx: Unexpected token, expected ")" </code></p>
<p dir="auto">I'm pretty sure this is a problem with babel because it works perfectly on ts-loader and tsc.<br>
Also, I've tried two different babel settings</p>
<ol dir="auto">
<li>create-react-app 2.1</li>
<li>custom webpack config with  <code class="notranslate">@babel/preset-typescript</code></li>
</ol>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type NumChangeHandler = ({ target }: any) =&gt; void"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">NumChangeHandler</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> target <span class="pl-kos">}</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
ts-loader with webpack supported this syntax. Also is fine with tsc.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="create-react-app 2.1 configurations"><pre class="notranslate"><span class="pl-s1">create</span><span class="pl-c1">-</span><span class="pl-s1">react</span><span class="pl-c1">-</span><span class="pl-s1">app</span> <span class="pl-c1">2.1</span> <span class="pl-s1">configurations</span></pre></div>
<p dir="auto"><em>OR</em></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
	&quot;presets&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-ent">"presets"</span>: [
			<span class="pl-s"><span class="pl-pds">"</span>@babel/typescript<span class="pl-pds">"</span></span>
	],
	<span class="pl-ent">"plugins"</span>: [
			<span class="pl-s"><span class="pl-pds">"</span>@babel/proposal-class-properties<span class="pl-pds">"</span></span>,
			<span class="pl-s"><span class="pl-pds">"</span>@babel/proposal-object-rest-spread<span class="pl-pds">"</span></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.13/npm 6.4.1</li>
<li>OS: mac OS 10.13.6</li>
<li>Monorepo: no</li>
<li>How you are using Babel: Create-react-app 2.1.1</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><strong>Additional context/Screenshots</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18115360/48622816-548e5300-e9eb-11e8-86de-abcf99adc23c.png"><img src="https://user-images.githubusercontent.com/18115360/48622816-548e5300-e9eb-11e8-86de-abcf99adc23c.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
Code fails with Babel, works with TSC.</p>
<p dir="auto"><strong>Input Code</strong></p>
<ul dir="auto">
<li><a href="https://babeljs.io/repl#?babili=false&amp;browsers=&amp;build=&amp;builtIns=false&amp;spec=false&amp;loose=false&amp;code_lz=C4TwDgpgBAsiAq5oF4oAoDeVgAsIFtoBfALii1wIjIGdgAnASwDsBzKIgSimQD4o6TNgChhAYwD2zOlAAeZOIkg9yRIA&amp;debug=false&amp;forceAllTransforms=false&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=true&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=module&amp;lineWrap=false&amp;presets=typescript&amp;prettier=false&amp;targets=&amp;version=7.0.0-beta.54&amp;envVersion=" rel="nofollow">Babel REPL</a> (ps: needs to install the <code class="notranslate">@babel/plugin-transform-typescript</code> plugin)</li>
<li><a href="http://www.typescriptlang.org/play/#src=type%20MyType%20%3D%20(%7B%20theme%20%7D%3A%20%7B%20theme%3A%20string%20%7D)%20%3D%3E%20string%0D%0A%0D%0Aconst%20x%3A%20MyType%20%3D%20%7B%7D" rel="nofollow">TypeScript Playground</a></li>
</ul>
<p dir="auto">This code fails on Babel but not on TSC:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type MyType = ({ theme }: { theme: string }) =&gt; string

const x: MyType = {}"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">MyType</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> theme <span class="pl-kos">}</span>: <span class="pl-kos">{</span> <span class="pl-c1">theme</span>: <span class="pl-smi">string</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span>

<span class="pl-k">const</span> <span class="pl-s1">x</span>: <span class="pl-smi">MyType</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">This code works on both:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type MyType = (param: { theme: string }) =&gt; string

const x: MyType = {}"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">MyType</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">param</span>: <span class="pl-kos">{</span> <span class="pl-c1">theme</span>: <span class="pl-smi">string</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">string</span>

<span class="pl-k">const</span> <span class="pl-s1">x</span>: <span class="pl-smi">MyType</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong></p>
<p dir="auto">Support this syntax, because tsc supports it.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">The one inside Create React App v2, plus typescript preset. (<a href="https://github.com/brunolemos/create-react-app/blob/next-typescript/packages/babel-preset-react-app/create.js">file</a>)</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.1.0</li>
<li>Node/npm version: 5.6.0</li>
<li>OS: macOS 10.14</li>
<li>Monorepo yes (yarn workspace)</li>
<li>How you are using Babel: CRA</li>
</ul>
<p dir="auto"><strong>Additional context</strong></p>
<p dir="auto">Possibly related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="343621304" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/8365" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/8365/hovercard" href="https://github.com/babel/babel/issues/8365">#8365</a></p>