add Type::isError method
This one does not add too much value, but I just didn't want to do instanceof ErrorType in my extensions 😄
Do you also feel like doing isNever() + isExplicitNever()? :)
Do you also feel like doing
isNever()+isExplicitNever()? :)
Didn't ever need that I guess, but sure I can. In a separate PR?
The mutations look valid, but I don't know how I can change them in bulk.
Edit: I guess $type instanceof ErrorType could be !$type->isError()->no() and !$type instanceof ErrorType can be $type->isError()->no() ?
I'm not sure how to cover the mutations with tests here. i'm more concerned about the things the issue bot found https://github.com/phpstan/phpstan-src/actions/runs/19215786400, I'm not sure why that's happening.
just a gut feeling in case the 2 above comments regarding behaviour changes are not valid:
another source of problems could be
class ErrorType extends MixedTypeclass TemplateMixedType extends MixedType
because MixedType - because of substraction logic - might lead to a Maybe.
In #4547
$expressionType instanceof NeverTypeby
!$expressionType->isNever()->no()But here you're replacing
$type instanceof ErrorTypeby
$type->isError()->yes()How did you choose ? I feel like we should have consistency...
Yeah we should have consistency. In the isNever PR I did it that way to see how the mutation testing will behave. But honestly I'd rather have $type->isError()->yes() everywhere, it's much easier to understand. So I'll change the other PR later.