Skip to content

Add support for generic types to the compiler #11057

@Tragetaschen

Description

@Tragetaschen

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
The compiler doesn't emit any generic type parameters and compiling that TypeScript code fails with Generic type ... requires 1 type argument(s)

Expected/desired behavior
The compiler should use generic type information

  • Angular version: 2.0.0-rc.5
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [ TypeScript X.X ]

In my code base, there are a couple of places where I use generic types to help me share code while not lose type information. Up until now, these only existed at compile time and the runtime compiler only saw the JavaScript code without any type information. With the AoT compiler, I currently have to remove all that type information and reduce it to any (shudder), because the compiler just ignores generic parameters. There are two distinct examples in my code base, which I'll put into separate comments.

Metadata

Metadata

Assignees

Labels

featureIssue that requests a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions