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:
parent
8f129f828b
commit
3599c20316
@ -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,
|
||||
|
@ -967,6 +967,13 @@ class AnnotationTest extends TestCase
|
||||
'$b' => 'array<array-key, int>',
|
||||
]
|
||||
],
|
||||
'noExceptionOnIntersection' => [
|
||||
'<?php
|
||||
class Foo {
|
||||
/** @var null|\DateTime&\DateTimeImmutable */
|
||||
private $s = null;
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user