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

Generated declaration missing generic #11035

Closed
OliverJAsh opened this issue Sep 21, 2016 · 3 comments
Closed

Generated declaration missing generic #11035

OliverJAsh opened this issue Sep 21, 2016 · 3 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Sep 21, 2016

2@rc

Given:

export type Bar<X, Y> = () => [X, Y];
export type Foo<Y> = Bar<any, Y>;
export const y = (x: Foo<string>) => 1

If I compile this with "declaration": true", the generated declaration file looks like:

export declare type Bar<X, Y> = () => [X, Y];
export declare type Foo<Y> = Bar<any, Y>;
export declare const y: (x: Bar<string>) => number;

Notice that the typings for y are incorrect: the parameter x should be of type Foo<string> which is an alias for Bar<any, string>, however it is incorrectly typed as Bar<string>. The first generic to Bar has gone missing.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Sep 21, 2016
@RyanCavanaugh
Copy link
Member

@mhegazy take this for 2.0?

@mhegazy
Copy link
Contributor

mhegazy commented Sep 22, 2016

@yui can you take a look

@yuit
Copy link
Contributor

yuit commented Sep 26, 2016

PR is up need to add tests

  • Confirm that this bug isn't repo in "master" EDIT: Repo in master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority
Projects
None yet
Development

No branches or pull requests

4 participants