-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[2.x] Ensure void return type translates to null #63
base: 2.x
Are you sure you want to change the base?
Conversation
🏰 Composer Production Dependency changes 🏰
|
1 similar comment
🚧 Composer Development Dependency changes 🚧
|
@@ -26,13 +26,30 @@ | |||
/** | |||
* Await | |||
*/ | |||
assertType('bool', $bridge->await(run(static function (): bool { | |||
return true; | |||
assertType('null', $bridge->await(run(static function (): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is misplaced here too.
Same as reactphp-parallel/infinite-pool#60 (comment)
You cannot take the value of a void
expression, as it is has no possible value.
You can turn it into an expression by having a closure around it:
-assertType('null', $bridge->await(run(static function (): void {
+assertType('Closure(): void', (fn () => $bridge->await(run(static function (): void {
No description provided.