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

Isssue generating declaration files with object containing keywords as property #50483

Closed
Mister-Hope opened this issue Aug 27, 2022 · 4 comments · Fixed by #50537
Closed

Isssue generating declaration files with object containing keywords as property #50483

Mister-Hope opened this issue Aug 27, 2022 · 4 comments · Fixed by #50537
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@Mister-Hope
Copy link

Mister-Hope commented Aug 27, 2022

TS playground does not have 4.8.2 yet, but this issue can happends in 4.8 beta:

https://www.typescriptlang.org/play?moduleResolution=99&target=99&jsx=0&module=199&ts=4.8.0-beta#code/C4TwDgpgBAMg9gYwIYBsIBEnCVAvFAJQgTgCcATAHgGdhSBLAOwHMAaKRiANwlID4AUKEhQAwnEY9SweMjTjGAM3rNKAFSgQAHsAiNy1WIlQYsOfLJOZsfPIWJkqAqFFoMWrZ1DUC+AbiFwaEt5CWVVDW1dfUMQ02w7OOskW3wiEgoaOiY2KAAFJGl6VHU+fwEBbTAyYCgmXVJFJARoAHEIGWM0agB5MGB6CWp1TR09AyM5eJSoAG8vFyQwMAAuKABXRgBrRjgAd0YAlxdyCCb1lGA1hSlOqYVw0qPjkiUVAH41uIeVUqgAHw2+jOTAg5GeLkYSAAthBPq5siwAgBfCpVGpQV60KDMDpxQz4EZRcaxLrTPgACnmxygSzAnhpUNhDOOp3OlzWbKQFzuJmoPzYC0xYRUa3W1F4+IFdlmyM8yLW7V53T6AyGpQAlNcJLdviKIqlbNTjqQOutSIwoFyeVL9SiAkA

The DTS result is wrong because default is a keyword:

export declare const getLocales: <T extends LocaleData>({ app, name, default, config, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>;

Meanwhile older ts versions work well:

https://www.typescriptlang.org/play?moduleResolution=99&target=99&jsx=0&module=199&ts=4.7.4#code/C4TwDgpgBAMg9gYwIYBsIBEnCVAvFAJQgTgCcATAHgGdhSBLAOwHMAaKRiANwlID4AUKEhQAwnEY9SweMjTjGAM3rNKAFSgQAHsAiNy1WIlQYsOfLJOZsfPIWJkqAqFFoMWrZ1DUC+AbiFwaEt5CWVVDW1dfUMQ02w7OOskW3wiEgoaOiY2KAAFJGl6VHU+fwEBbTAyYCgmXVJFJARoAHEIGWM0agB5MGB6CWp1TR09AyM5eJSoAG8vFyQwMAAuKABXRgBrRjgAd0YAlxdyCCb1lGA1hSlOqYVw0qPjkiUVAH41uIeVUqgAHw2+jOTAg5GeLkYSAAthBPq5siwAgBfCpVGpQV60KDMDpxQz4EZRcaxLrTPgACnmxygSzAnhpUNhDOOp3OlzWbKQFzuJmoPzYC0xYRUa3W1F4+IFdlmyM8yLW7V53T6AyGpQAlNcJLdviKIqlbNTjqQOutSIwoFyeVL9SiAkA

export declare const getLocales: <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>;

I think this is a critial bug and should be fixed in 4.8.3 asap


Also I was curious:

  1. why could this happends? Is related test cases missing? Maybe the team should check test cases and add some releated test into it.
  2. When will you update your website? Hours passes after releasing 4.8 to stable, maybe the team can update ts playground faster, and that DOES help developers.
@Mister-Hope Mister-Hope changed the title Default keyword lets to issue Isssue generating declaration files with object containing keywords as property Aug 27, 2022
@Mister-Hope
Copy link
Author

Mister-Hope commented Aug 28, 2022

@MartinJohns So why thumbs down.

So you think this is a complicated snippet? Or it's normal for a project with 83.7k stars and 676 contributors should keep the website outdated days after new version? I have open source project too, 1 is probably ok if no one ever comes out the idea to add related test. But I don't think it's ok for 2.

image

@MartinJohns
Copy link
Contributor

MartinJohns commented Aug 28, 2022

I have the tendency to give the down thumb to issues ignoring the issue templates. Weird flex, I know.

Also, this sounds extremely entitled and rude:

When will you update your website? Hours passes after releasing 4.8 to stable, maybe the team can update ts playground faster, and that DOES help developers.

@jakebailey
Copy link
Member

I did a bisect, and #41044 did change this, yes.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Aug 29, 2022
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.8.1 milestone Aug 29, 2022
@RyanCavanaugh
Copy link
Member

I agree this is a 4.8 patch candidate. cc @andrewbranch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
7 participants