Skip to content

Generated declaration missing generic #11035

Closed
@OliverJAsh

Description

@OliverJAsh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHigh Priority

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions