mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
fix #2010 - properties with defaults should work with static type
This commit is contained in:
parent
62451762fa
commit
4046b44903
@ -101,7 +101,7 @@ class PropertyAssignmentAnalyzer
|
||||
$codebase,
|
||||
$class_property_type,
|
||||
$context->self,
|
||||
null,
|
||||
$context->self,
|
||||
$class_storage->parent_class
|
||||
);
|
||||
}
|
||||
|
@ -1693,6 +1693,16 @@ class PropertyTypeTest extends TestCase
|
||||
|
||||
echo (new B)->bar;'
|
||||
],
|
||||
'staticPropertyDefaultWithStaticType' => [
|
||||
'<?php
|
||||
class Test {
|
||||
/** @var array<int, static> */
|
||||
private static $t1 = [];
|
||||
|
||||
/** @var array<int, static> */
|
||||
private $t2 = [];
|
||||
}'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user