mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
commit
205e8cc73e
@ -601,7 +601,7 @@ class AssertionReconciler extends Reconciler
|
||||
$codebase,
|
||||
$type_1_atomic,
|
||||
$type_2_atomic,
|
||||
!($type_1_atomic instanceof TNamedObject && $type_2_atomic instanceof TNamedObject),
|
||||
$type_1_atomic instanceof TClassString && $type_2_atomic instanceof TClassString,
|
||||
false,
|
||||
$atomic_comparison_results
|
||||
);
|
||||
|
@ -19,6 +19,31 @@ class TypeTest extends TestCase
|
||||
public function providerValidCodeParse(): iterable
|
||||
{
|
||||
return [
|
||||
'instanceOfInterface' => [
|
||||
'code' => '<?php
|
||||
interface Supplier {
|
||||
public function get(): iterable;
|
||||
}
|
||||
|
||||
class SomeClass {
|
||||
protected Supplier|iterable $prop;
|
||||
|
||||
public function __construct(Supplier|iterable $value) {
|
||||
$this->prop = $value;
|
||||
}
|
||||
|
||||
public function do(): void {
|
||||
$var = $this->prop;
|
||||
|
||||
if ($var instanceof Supplier) {
|
||||
$var->get();
|
||||
}
|
||||
}
|
||||
}',
|
||||
'assertions' => [],
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.0'
|
||||
],
|
||||
'nullableMethodWithTernaryGuard' => [
|
||||
'code' => '<?php
|
||||
class A {
|
||||
|
Loading…
x
Reference in New Issue
Block a user