Closed
Description
TypeScript Version: 2.1.4
tsc
is run with --experimentalDecorators
and --emitDecoratorMetadata
Code
function foo(_: any) {}
@foo
class Foo {
constructor(public bar: number) {}
}
@foo
class Bar extends Foo {
}
Expected behavior:
Bar = __decorate([
foo,
- __metadata("design:paramtypes", [])
+ __metadata("design:paramtypes", [Number])
], Bar);
Metadata for subclass with default constructor should include parameter types of super constructor.
Actual behavior:
tsc
emit:
/* ... helper functions ... */
function foo(_) { }
var Foo = (function () {
function Foo(bar) {
this.bar = bar;
}
return Foo;
}());
Foo = __decorate([
foo,
__metadata("design:paramtypes", [Number])
], Foo);
var Bar = (function (_super) {
__extends(Bar, _super);
function Bar() {
return _super.apply(this, arguments) || this;
}
return Bar;
}(Foo));
Bar = __decorate([
foo,
__metadata("design:paramtypes", [])
], Bar);