-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
area: plugin orderingoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current Behavior
When using @babel/plugin-proposal-decorators alongside @babel/preset-typescript function overloading does not work.
TypeError: Duplicated element (nameOfOverloadedClassMethod)
This is the transpiled output:
{
kind: "field",
key: "nameOfOverloadedClassMethod",
value: void 0
}, {
kind: "field",
key: "nameOfOverloadedClassMethod",
value: void 0
}, {
kind: "method",
key: "nameOfOverloadedClassMethod",
value: function value(_bar) {
// actual body of method
}
}Input Code
class Foo {
nameOfOverloadedClassMethod(bar: string);
nameOfOverloadedClassMethod(bar: number);
nameOfOverloadedClassMethod(bar) {
// some implementation
}
}Expected behavior/code
The overloaded methods are removed when transpiling before decorators mangle the class.
Babel Configuration (.babelrc, package.json, cli command)
{
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'
]
}
}Environment
- Babel version(s): v7.2.0
- Node/npm version: Node 9.11.2
- OS: OSX 10.14.1
- Monorepo: no
- How you are using Babel:
loader
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: plugin orderingoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue