<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<p dir="auto">When using <strong>@babel/plugin-proposal-decorators</strong> alongside <strong>@babel/preset-typescript</strong> <a href="https://www.typescriptlang.org/docs/handbook/functions.html#overloads" rel="nofollow">function overloading</a> does not work.</p>
<p dir="auto"><code class="notranslate">TypeError: Duplicated element (nameOfOverloadedClassMethod)</code></p>
<p dir="auto">This is the transpiled output:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  kind: &quot;field&quot;,
  key: &quot;nameOfOverloadedClassMethod&quot;,
  value: void 0
}, {
  kind: &quot;field&quot;,
  key: &quot;nameOfOverloadedClassMethod&quot;,
  value: void 0
}, {
  kind: &quot;method&quot;,
  key: &quot;nameOfOverloadedClassMethod&quot;,
  value: function value(_bar) {
    // actual body of method
  }
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-c1">kind</span>: <span class="pl-s">"field"</span><span class="pl-kos">,</span>
  <span class="pl-c1">key</span>: <span class="pl-s">"nameOfOverloadedClassMethod"</span><span class="pl-kos">,</span>
  <span class="pl-c1">value</span>: <span class="pl-k">void</span> <span class="pl-c1">0</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">kind</span>: <span class="pl-s">"field"</span><span class="pl-kos">,</span>
  <span class="pl-c1">key</span>: <span class="pl-s">"nameOfOverloadedClassMethod"</span><span class="pl-kos">,</span>
  <span class="pl-c1">value</span>: <span class="pl-k">void</span> <span class="pl-c1">0</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">kind</span>: <span class="pl-s">"method"</span><span class="pl-kos">,</span>
  <span class="pl-c1">key</span>: <span class="pl-s">"nameOfOverloadedClassMethod"</span><span class="pl-kos">,</span>
  <span class="pl-en">value</span>: <span class="pl-k">function</span> <span class="pl-en">value</span><span class="pl-kos">(</span><span class="pl-s1">_bar</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// actual body of method</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<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="class Foo {
  nameOfOverloadedClassMethod(bar: string);
  nameOfOverloadedClassMethod(bar: number);
  nameOfOverloadedClassMethod(bar) {
    // some implementation
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-c1">nameOfOverloadedClassMethod</span><span class="pl-kos">(</span><span class="pl-s1">bar</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-c1">nameOfOverloadedClassMethod</span><span class="pl-kos">(</span><span class="pl-s1">bar</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">nameOfOverloadedClassMethod</span><span class="pl-kos">(</span><span class="pl-s1">bar</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// some implementation</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">The overloaded methods are removed when transpiling before decorators mangle the class.</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="{
  loader: 'babel-loader',
  options: {
    presets: [
      [
        '@babel/preset-env',
        {
          modules: false,
          useBuiltIns: 'usage'
        }
      ],
      '@babel/typescript'
    ],
    plugins: [
      ['@babel/plugin-proposal-decorators', {
        decoratorsBeforeExport: true
      }],
      '@babel/plugin-proposal-class-properties',
      '@babel/plugin-proposal-object-rest-spread',
      '@babel/plugin-transform-runtime',
      'angularjs-annotate'
    ]
  }
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-c1">loader</span>: <span class="pl-s">'babel-loader'</span><span class="pl-kos">,</span>
  <span class="pl-c1">options</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">presets</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-c1">modules</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
          <span class="pl-c1">useBuiltIns</span>: <span class="pl-s">'usage'</span>
        <span class="pl-kos">}</span>
      <span class="pl-kos">]</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-c1">plugins</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-c1">decoratorsBeforeExport</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">'@babel/plugin-proposal-class-properties'</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-s">'@babel/plugin-transform-runtime'</span><span class="pl-kos">,</span>
      <span class="pl-s">'angularjs-annotate'</span>
    <span class="pl-kos">]</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): v7.2.0</li>
<li>Node/npm version: Node 9.11.2</li>
<li>OS: OSX 10.14.1</li>
<li>Monorepo: no</li>
<li>How you are using Babel: <code class="notranslate">loader</code></li>
</ul>
<h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">Programmatic API (<code class="notranslate">babel.transform</code>, <code class="notranslate">babel.parse</code>)</p>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export type Foo = {
	args: [ [
		object: number
	] ];
};"><pre class="notranslate"><span class="pl-s1">export</span> <span class="pl-s1">type</span> <span class="pl-v">Foo</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
	<span class="pl-c1">args</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span>
		<span class="pl-s1">object</span>: <span class="pl-s1">number</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>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Configuration</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">Current:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/repl.ts: Tuple members must be labeled with a simple identifier. (3:2)

  1 | export type Foo = {
  2 | 	args: [ [
&gt; 3 | 		object: number
    | 		^
  4 | 	] ];
  5 | };"><pre class="notranslate"><code class="notranslate">/repl.ts: Tuple members must be labeled with a simple identifier. (3:2)

  1 | export type Foo = {
  2 | 	args: [ [
&gt; 3 | 		object: number
    | 		^
  4 | 	] ];
  5 | };
</code></pre></div>
<p dir="auto">Expected:</p>
<p dir="auto">No errors.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Binaries:
<ul dir="auto">
<li>Node: 19.4.0 - /usr/local/bin/node</li>
<li>Yarn: 1.22.18 - ~/.yarn/bin/yarn</li>
<li>npm: 8.5.5 - /usr/local/bin/npm</li>
</ul>
</li>
<li>Monorepos:
<ul dir="auto">
<li>Yarn Workspaces: 1.22.18</li>
</ul>
</li>
<li>npmPackages:
<ul dir="auto">
<li>babel-standalone: ^6.26.0 =&gt; 6.26.0</li>
<li>eslint: ^7.19.0 =&gt; 7.32.0</li>
<li>webpack: ^5.58.1 =&gt; 5.75.0</li>
</ul>
</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><a href="https://babeljs.io/repl#?browsers=defaults&amp;build=&amp;builtIns=false&amp;corejs=3.6&amp;spec=false&amp;loose=false&amp;code_lz=KYDwDg9gTgLgBDAnmYcBiEJwLxwN4BQAkAIZQDmAzgFxwDa9xREARgFbADGMtAdgK4BbFsCjEAunHEBuAgF9pQA&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=true&amp;presets=env%2Cstage-2%2Ctypescript&amp;prettier=false&amp;targets=Node-14&amp;version=7.20.15&amp;externalPlugins=&amp;assumptions=%7B%7D" rel="nofollow">https://babeljs.io/repl#?browsers=defaults&amp;build=&amp;builtIns=false&amp;corejs=3.6&amp;spec=false&amp;loose=false&amp;code_lz=KYDwDg9gTgLgBDAnmYcBiEJwLxwN4BQAkAIZQDmAzgFxwDa9xREARgFbADGMtAdgK4BbFsCjEAunHEBuAgF9pQA&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=true&amp;presets=env%2Cstage-2%2Ctypescript&amp;prettier=false&amp;targets=Node-14&amp;version=7.20.15&amp;externalPlugins=&amp;assumptions=%7B%7D</a></p>