1
0
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:
Matt Brown 2017-01-19 14:49:49 -05:00
parent 77ff99206e
commit 2a8e51f544
2 changed files with 5 additions and 1 deletions

View File

@ -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;
} }

View File

@ -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();