1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix #1641 - crawl intersection types

This commit is contained in:
Matthew Brown 2019-05-15 22:30:35 -04:00
parent 8f129f828b
commit 3599c20316
2 changed files with 22 additions and 0 deletions

View File

@ -605,6 +605,21 @@ abstract class Atomic
}
}
if ($this instanceof TNamedObject
|| $this instanceof TIterable
|| $this instanceof TTemplateParam
) {
if ($this->extra_types) {
foreach ($this->extra_types as $extra_type) {
$extra_type->queueClassLikesForScanning(
$codebase,
$file_storage,
$phantom_classes
);
}
}
}
if ($this instanceof TScalarClassConstant) {
$codebase->scanner->queueClassLikeForScanning(
$this->fq_classlike_name,

View File

@ -967,6 +967,13 @@ class AnnotationTest extends TestCase
'$b' => 'array<array-key, int>',
]
],
'noExceptionOnIntersection' => [
'<?php
class Foo {
/** @var null|\DateTime&\DateTimeImmutable */
private $s = null;
}',
],
];
}