Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Feb 2, 2023
1 parent df41d50 commit 1874329
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/TypeReconciliation/TypeAlgebraTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,23 @@ function test(string|object $s, bool $b) : string {
'ignored_issues' => [],
'php_version' => '8.0',
],
'subclassAfterNegation' => [
'code' => '<?php
abstract class Base {}
class A extends Base {}
class AChild extends A {}
class B extends Base {
public string $s = "";
}
function foo(Base $base): void {
if (!$base instanceof A || $base instanceof AChild) {
if ($base instanceof B && rand(0, 1)) {
echo $base->s;
}
}
}'
],
];
}

Expand Down

0 comments on commit 1874329

Please sign in to comment.