Support union of non identifier serialized type node with null/undefined/never

This commit is contained in:
Sheetal Nandi
2016-11-29 12:42:17 -08:00
parent 59403796c7
commit 73a829279a
5 changed files with 168 additions and 47 deletions

View File

@@ -25,6 +25,21 @@ class B {
@PropDeco
d: undefined | null;
@PropDeco
e: symbol | null;
@PropDeco
f: symbol | A;
@PropDeco
g: A | null;
@PropDeco
h: null | B;
@PropDeco
j: null | symbol;
}
//// [metadataOfUnionWithNull.js]
@@ -54,7 +69,7 @@ __decorate([
], B.prototype, "x");
__decorate([
PropDeco,
__metadata("design:type", Object)
__metadata("design:type", Boolean)
], B.prototype, "y");
__decorate([
PropDeco,
@@ -66,7 +81,7 @@ __decorate([
], B.prototype, "a");
__decorate([
PropDeco,
__metadata("design:type", Object)
__metadata("design:type", void 0)
], B.prototype, "b");
__decorate([
PropDeco,
@@ -76,3 +91,23 @@ __decorate([
PropDeco,
__metadata("design:type", void 0)
], B.prototype, "d");
__decorate([
PropDeco,
__metadata("design:type", typeof Symbol === "function" ? Symbol : Object)
], B.prototype, "e");
__decorate([
PropDeco,
__metadata("design:type", Object)
], B.prototype, "f");
__decorate([
PropDeco,
__metadata("design:type", A)
], B.prototype, "g");
__decorate([
PropDeco,
__metadata("design:type", B)
], B.prototype, "h");
__decorate([
PropDeco,
__metadata("design:type", typeof Symbol === "function" ? Symbol : Object)
], B.prototype, "j");

View File

@@ -53,4 +53,37 @@ class B {
d: undefined | null;
>d : Symbol(B.d, Decl(metadataOfUnionWithNull.ts, 22, 17))
@PropDeco
>PropDeco : Symbol(PropDeco, Decl(metadataOfUnionWithNull.ts, 0, 0))
e: symbol | null;
>e : Symbol(B.e, Decl(metadataOfUnionWithNull.ts, 25, 24))
@PropDeco
>PropDeco : Symbol(PropDeco, Decl(metadataOfUnionWithNull.ts, 0, 0))
f: symbol | A;
>f : Symbol(B.f, Decl(metadataOfUnionWithNull.ts, 28, 21))
>A : Symbol(A, Decl(metadataOfUnionWithNull.ts, 0, 63))
@PropDeco
>PropDeco : Symbol(PropDeco, Decl(metadataOfUnionWithNull.ts, 0, 0))
g: A | null;
>g : Symbol(B.g, Decl(metadataOfUnionWithNull.ts, 31, 18))
>A : Symbol(A, Decl(metadataOfUnionWithNull.ts, 0, 63))
@PropDeco
>PropDeco : Symbol(PropDeco, Decl(metadataOfUnionWithNull.ts, 0, 0))
h: null | B;
>h : Symbol(B.h, Decl(metadataOfUnionWithNull.ts, 34, 16))
>B : Symbol(B, Decl(metadataOfUnionWithNull.ts, 3, 1))
@PropDeco
>PropDeco : Symbol(PropDeco, Decl(metadataOfUnionWithNull.ts, 0, 0))
j: null | symbol;
>j : Symbol(B.j, Decl(metadataOfUnionWithNull.ts, 37, 16))
}

View File

@@ -56,5 +56,42 @@ class B {
d: undefined | null;
>d : null
>null : null
@PropDeco
>PropDeco : (target: Object, propKey: string | symbol) => void
e: symbol | null;
>e : symbol
>null : null
@PropDeco
>PropDeco : (target: Object, propKey: string | symbol) => void
f: symbol | A;
>f : symbol | A
>A : A
@PropDeco
>PropDeco : (target: Object, propKey: string | symbol) => void
g: A | null;
>g : A
>A : A
>null : null
@PropDeco
>PropDeco : (target: Object, propKey: string | symbol) => void
h: null | B;
>h : B
>null : null
>B : B
@PropDeco
>PropDeco : (target: Object, propKey: string | symbol) => void
j: null | symbol;
>j : symbol
>null : null
}

View File

@@ -26,4 +26,19 @@ class B {
@PropDeco
d: undefined | null;
@PropDeco
e: symbol | null;
@PropDeco
f: symbol | A;
@PropDeco
g: A | null;
@PropDeco
h: null | B;
@PropDeco
j: null | symbol;
}