We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: 4.0.2
Search Terms: signature void parameter optional assignability
Code
declare function f(a: number, b?: void): void; declare function g(a: number, b: void): void; f(1); // ok g(1); // ok let ff: (a: number) => void = f; // ok let gg: (a: number) => void = g; // error
Expected behavior:
g should be assignable to gg since we treat void parameters as optional.
g
gg
void
Actual behavior:
g is not assignable to gg.
Playground Link: link
Related Issues: #39817, #29131
The text was updated successfully, but these errors were encountered:
Also Related Issues: #29131
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
TypeScript Version: 4.0.2
Search Terms: signature void parameter optional assignability
Code
Expected behavior:
g
should be assignable togg
since we treatvoid
parameters as optional.Actual behavior:
g
is not assignable togg
.Playground Link: link
Related Issues: #39817, #29131
The text was updated successfully, but these errors were encountered: