-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Emit metadata with union constituents #19154
Copy link
Copy link
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
Right now, when we emit meta data of one property that is defined as:
class A {
@Property()
p1: 's1' | 's2';
}We emit the metadata as:
__metadata("design:type", String)So, whoever is using this metadata cannot know the literal types of p1. A library author has to decorate the literal types s1 and s2 in order to access these literal types:
class A {
@Property(strings: ['s1', 's2'])
p1: 's1' | 's2';
}Why don't we just emit it as an array instead?
__metadata("design:type", ['union', 's1', 's2'])Related to:
#12703
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created