Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 2, 2026

this does not work yet and I don't know why.
leaving it here as someone might have ideas

Comment on lines +3395 to +3396
$expressionTypes[$exprString] = $newHolder;
$nativeTypes[$exprString] = $newNativeHolder;
Copy link
Contributor Author

@staabm staabm Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the same test-errors no matter whether I re-use the whole $scope, or just the ExpressionTypeHolder. need to debug it further.

interessting test errors are:

PHPStan\Rules\Classes\ImpossibleInstanceOfRuleTest::testNewIsAlwaysFinalClass
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 '17: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar and ImpossibleInstanceofNewIsAlwaysFinal\Foo will always evaluate to false.
-33: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar and ImpossibleInstanceofNewIsAlwaysFinal\Foo will always evaluate to false.
-43: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar and ImpossibleInstanceofNewIsAlwaysFinal\Foo will always evaluate to false.
-53: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar and ImpossibleInstanceofNewIsAlwaysFinal\Foo will always evaluate to false.
-63: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar and ImpossibleInstanceofNewIsAlwaysFinal\Foo will always evaluate to false.
 73: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar|null and ImpossibleInstanceofNewIsAlwaysFinal\Foo will always evaluate to false.
 88: Instanceof between ImpossibleInstanceofNewIsAlwaysFinal\Bar|null and ImpossibleInstanceofNewIsAlwaysFinal\Baz will always evaluate to false.
 '

/Users/staabm/workspace/phpstan-src/src/Testing/RuleTestCase.php:236
/Users/staabm/workspace/phpstan-src/tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php:529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant