Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design-type metadata for generic types #11860

Closed
heruan opened this issue Oct 26, 2016 · 1 comment
Closed

Design-type metadata for generic types #11860

heruan opened this issue Oct 26, 2016 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@heruan
Copy link

heruan commented Oct 26, 2016

Design-type metadata such as design:type, design:paramtypes and design:returntype are great to build modern JavaScript frameworks. It would be very useful to also have a design:generics metadata to keep track of generic types, e.g.

class Foo {}
class Bar {}
class Baz {
    map: Map<Foo, Bar>;
}

would transpile to

// ... Foo and Bar functions
var Baz = (function () {
    function Baz() {
    }
    __decorate([
        __metadata('design:type', Map),
        __metadata('design:generics', [ Foo, Bar ]),
    ], Baz.prototype, "map", void 0);
    return Baz;
}());
@mhegazy
Copy link
Contributor

mhegazy commented Oct 26, 2016

The issue of type serialization/"reflection" has been discussed multiple times (#2902, #2577, #3060). we already have #3628 to track this discussion; so i suggest moving this proposal to that issue.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Oct 26, 2016
@mhegazy mhegazy closed this as completed Oct 26, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants