1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 01:37:23 +01:00

refine types in Always methods

This commit is contained in:
orklah 2021-09-22 22:21:29 +02:00
parent 2df1f9d42e
commit b14fccb654

View File

@ -985,6 +985,18 @@ class Union implements TypeNode
continue;
}
if ($atomic_type instanceof Type\Atomic\TEmptyMixed) {
continue;
}
if ($atomic_type instanceof Type\Atomic\TEmptyNumeric) {
continue;
}
if ($atomic_type instanceof Type\Atomic\TEmptyScalar) {
continue;
}
if ($atomic_type instanceof TTemplateParam && $atomic_type->as->isAlwaysFalsy()) {
continue;
}
@ -1033,7 +1045,11 @@ class Union implements TypeNode
continue;
}
if ($atomic_type instanceof Type\Atomic\TNonFalsyString) {
if ($atomic_type instanceof Type\Atomic\TNonEmptyString) {
continue;
}
if ($atomic_type instanceof Type\Atomic\TNonEmptyNonspecificLiteralString) {
continue;
}
@ -1069,6 +1085,10 @@ class Union implements TypeNode
continue;
}
if ($atomic_type instanceof Type\Atomic\TTraitString) {
continue;
}
if ($atomic_type instanceof Type\Atomic\TResource) {
continue;
}