TypeScript Version: 2.1.4
Code
module MyModule {
export function inject(target: any, key: string): void {}
export class Leg {}
export class Person {
@inject leftLeg: Leg;
}
}
Compiled with:
tsc --experimentalDecorators --emitDecoratorMetadata -target es5 app.ts
Expected behavior:
The design:type metadata inserted uses type Object instead of the actual type
__decorate([
inject,
__metadata("design:type", Object)
], Person.prototype, "leftArm", void 0);
Actual behavior:
The design:type metadata should be set to the correct type (Leg in this case)
__decorate([
inject,
__metadata("design:type", Leg)
], Person.prototype, "leftArm", void 0);
Note: This was working in previous version (we were on 1.8.10) and broke after upgrading to 2.1.4
TypeScript Version: 2.1.4
Code
Compiled with:
tsc --experimentalDecorators --emitDecoratorMetadata -target es5 app.tsExpected behavior:
The
design:typemetadata inserted uses typeObjectinstead of the actual typeActual behavior:
The
design:typemetadata should be set to the correct type (Legin this case)Note: This was working in previous version (we were on
1.8.10) and broke after upgrading to2.1.4