-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
[transpileDeclaration API][5.5] Type assertion is ignored #58564
Comments
Hm, I think this one might be because @dragomirtitian thoughts? Technically, syntactically promise wrapping the cast node isn't fully correct, since if the cast is to another promise type, you should unwrap it and then promise wrap that unwrapped thing ( |
I think there's something fishy with the Workbench tool. Even without any promise wrapping, even on TS 5.4, the workbench DTS output pane incorrect states // @declaration: true
// @showEmit
// @showEmittedFile: a.d.ts
// @filename: a.ts
export async function foo() {
return 42;
}
export declare function foo(): unknown; |
π Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of the repro in the issue body running against the nightly TypeScript. Issue body code block by @MichaelMitchell-at π Compiled export declare function foo(): Promise<number>; Historical Information
|
π Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of this repro running against the nightly TypeScript. π Compiled export declare function foo(): Promise<number>; Historical Information
|
π Search Terms
transpiledeclaration type assertion as cast unknown promise async await
π Version & Regression Information
5.5.0-dev.20240517
β― Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?target=7&ts=5.5.0-dev.20240502#code/PTAEAEGcBcCcEsDG0Bco4FcCmAoEEATLRAGwENYzp4B7AOzU13ygAsaB3AUQFt5o8YNp179oWAgDF4JLGjIA6AguiQcgiADMZWOmR5zQi1TiwAPAA41Y0I5ACedRKE0Yn1ei5o0AFAEpQAG8cUFBYLGgMWDpQHzIOMn5QABYAJgCySFA6DB4AIyxYAG4cAF8cIA
π» Code
Workbench Repro
π Actual behavior
When using the API, a.d.ts is emitted as
while when using tsc it gets emitted as
π Expected behavior
Using the API should emit
Additional information about the issue
This might be the last issue within all the projects we've enabled isolated declarations for so far \o/ (still have many more to go though) which means that we soon might be able to enable parallel typechecking by default.
The text was updated successfully, but these errors were encountered: