Martin Herndl

Results 139 comments of Martin Herndl

I don't want to disturb the discussion here too much, so it's not important, but do you maybe know how this relates to https://github.com/phpstan/phpstan-src/pull/1781#pullrequestreview-1129131318? Would there be more changes needed...

with the many type related cleanups I do on 1.9.x we need to be careful to not cause conflicts if bigger type changes are made on 1.8.x still :)

> We need for it to work when `$s` is `callable&string` too, meaning the logic in IntersectionType::tryRemove is probably wrong? Or maybe it's not even called? it's not called correctly...

but you're also right :) even if the type is specified, it doesn't work yet. so there are 2 things here. I'll try to tackle one by one..

oh, actually the "removal does not work" is again related to the whole expression evaluating to a constant boolean. then `TypeCombinator::remove()` also early exits and doesn't touch the string type...

everything starts working of course if `(new ConstantStringType(''))->isSuperTypeOf(new CallableType())` answers with `maybe`, but that feels also very wrong, doesn't it? it should be `no` IMO. it will of course also...

> Have you seen my comment? The fix you're trying is different to what I suggested :) sorry, race-condition. yeah, I'm already trying it out :)

unfortunately your fix is not enough to make the type specifier + type removal work which is needed here I think :/

ah ok, got you. I was kind of focused also on the NodeScopeResolverTest for example. the thing is.. `StrictComparisonOfDifferentTypesRules` has, again, something like this that will not work here because...

🎉 nice that you figured out a simplified fix