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

5.8.2 generates incorrect d.ts for generics in static method #61334

Closed
crimx opened this issue Mar 3, 2025 · 2 comments Β· Fixed by #61342
Closed

5.8.2 generates incorrect d.ts for generics in static method #61334

crimx opened this issue Mar 3, 2025 · 2 comments Β· Fixed by #61342
Assignees
Labels
Bug A bug in TypeScript

Comments

@crimx
Copy link

crimx commented Mar 3, 2025

πŸ”Ž Search Terms

"5.8.2", "dts", "d.ts", "static", "generic"

πŸ•— Version & Regression Information

  • This changed between versions 5.7.3 and 5.8.2

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.8.2#code/KYDwDg9gTgLgBAQwEYGcZQQY3pgNglFOAQQB4AVOAXkQDsBPAGjgFVq76A+OAbwCg4guGACuSXAEtMcNAhhS4UYAgAmEWrnpwA6lHUBzdhWZsaCBpwAUANwS4RwAFxxyASmdlyJ7lW78hAYrAMCJQtHC0Iri4iETm9AJCAL58SUA

πŸ’» Code

export abstract class A<T = any, U = any> {
    public static readonly Fn = <T, U = any>(value: T): A<T, U> => {
        return null as any
    }
}

πŸ™ Actual behavior

Outputs d.ts(5.8.2):

export declare abstract class A<T = any, U = any> {
    static readonly Fn: <T, U = any>(value: T_1) => A<T_1, U_1>;
}

πŸ™‚ Expected behavior

Outputs d.ts(5.7.3):

export declare abstract class A<T = any, U = any> {
    static readonly Fn: <T_1, U_1 = any>(value: T_1) => A<T_1, U_1>;
}

Additional information about the issue

No response

@Andarist
Copy link
Contributor

Andarist commented Mar 3, 2025

Bisects to #60234

@jakebailey
Copy link
Member

@dragomirtitian @weswigham

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants