-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
function annotation(): PropertyDecorator {
return (target: any, key: string | symbol): void => { };
}
class A {
@annotation()
field: B | null | undefined;
}
class B {
field1: number;
}
Expected behavior:
function annotation() {
return function (target, key) { };
}
var A = (function () {
function A() {
}
__decorate([
annotation(),
__metadata('design:type', B)
], A.prototype, "field", void 0);
return A;
}());
var B = (function () {
function B() {
}
return B;
}());
Actual behavior:
function annotation() {
return function (target, key) { };
}
var A = (function () {
function A() {
}
__decorate([
annotation(),
__metadata('design:type', Object) //<-- should be B
], A.prototype, "field", void 0);
return A;
}());
var B = (function () {
function B() {
}
return B;
}());
achmedzhanov and tinganho
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug