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

[deno publish] Unexpected type error with rest parameters and overloads #23338

Closed
rojvv opened this issue Apr 12, 2024 · 1 comment · Fixed by #23340
Closed

[deno publish] Unexpected type error with rest parameters and overloads #23338

rojvv opened this issue Apr 12, 2024 · 1 comment · Fixed by #23340
Labels
bug Something isn't working correctly publish Related to "deno publish" subcommand

Comments

@rojvv
Copy link
Contributor

rojvv commented Apr 12, 2024

Command: deno publish --allow-dirty --dry-run

1.42.2:
zero-code exit

1.42.3:
Fails with the below output:

Check file:///Users/roj/MTKruto/mod.ts
Checking for slow types in the public API...
Check file:///Users/roj/MTKruto/mod.ts
error: Failed ensuring public API type output is valid.

TS1047 [ERROR]: A rest parameter cannot be optional.
  filter(param0?: any, ...param1?: any): any {
                                ^
    at file:///Users/roj/MTKruto/client/1_composer.ts:110:3

You may have discovered a bug in Deno. Please open an issue at: https://github.com/denoland/deno/issues/

The line it links to is

  filter(
    predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>,
    ...middleware: Middleware<UpdateIntersection<C>>[]
  )

...which doesn’t have optional rest parameters, or does it?

@dsherret
Copy link
Member

dsherret commented Apr 12, 2024

Regression caused by denoland/deno_graph#432 and fixed in denoland/deno_graph#435 (though it was not properly handled before)

We need to add type checking to those tests so we can catch stuff like this.

@dsherret dsherret added the bug Something isn't working correctly label Apr 12, 2024
@dsherret dsherret changed the title [deno publish] Unexpected type error [deno publish] Unexpected type error with rest parameters Apr 12, 2024
@dsherret dsherret changed the title [deno publish] Unexpected type error with rest parameters [deno publish] Unexpected type error with rest parameters and overloads Apr 12, 2024
@dsherret dsherret added the publish Related to "deno publish" subcommand label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly publish Related to "deno publish" subcommand
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants