mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix scalar assignment
This commit is contained in:
parent
77ff99206e
commit
2a8e51f544
@ -928,7 +928,7 @@ class TypeChecker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($input_type_part instanceof Scalar || $input_type_part instanceof TScalar) {
|
if ($input_type_part instanceof Scalar) {
|
||||||
if ($container_type_part instanceof Scalar) {
|
if ($container_type_part instanceof Scalar) {
|
||||||
$has_scalar_match = true;
|
$has_scalar_match = true;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ use Psalm\Type\Atomic\TArray;
|
|||||||
use Psalm\Type\Atomic\TMixed;
|
use Psalm\Type\Atomic\TMixed;
|
||||||
use Psalm\Type\Atomic\TObject;
|
use Psalm\Type\Atomic\TObject;
|
||||||
use Psalm\Type\Atomic\TResource;
|
use Psalm\Type\Atomic\TResource;
|
||||||
|
use Psalm\Type\Atomic\TScalar;
|
||||||
use Psalm\Type\Atomic\TCallable;
|
use Psalm\Type\Atomic\TCallable;
|
||||||
use Psalm\Type\Atomic\TNamedObject;
|
use Psalm\Type\Atomic\TNamedObject;
|
||||||
use Psalm\Type\Atomic\TNumericString;
|
use Psalm\Type\Atomic\TNumericString;
|
||||||
@ -63,6 +64,9 @@ abstract class Atomic extends Type
|
|||||||
case 'empty':
|
case 'empty':
|
||||||
return new TEmpty();
|
return new TEmpty();
|
||||||
|
|
||||||
|
case 'scalar':
|
||||||
|
return new TScalar();
|
||||||
|
|
||||||
case 'null':
|
case 'null':
|
||||||
return new TNull();
|
return new TNull();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user