-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass-by-ref argument type passed to callable should be mixed after ca…
…lling the callable
- Loading branch information
1 parent
0249e6d
commit 109bf99
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Bug5615; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
public function doFoo(): void | ||
{ | ||
$cb = function (bool &$save): void { | ||
|
||
}; | ||
$save = true; | ||
$cb($save); | ||
assertType('mixed', $save); | ||
} | ||
|
||
/** | ||
* @param callable(bool &$save): void $call | ||
*/ | ||
function get(callable $call) { | ||
$save = true; | ||
$call($save); | ||
assertType('mixed', $save); | ||
} | ||
|
||
} |