1
0
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:
Brown 2019-08-12 14:29:14 -04:00
parent 62451762fa
commit 4046b44903
2 changed files with 11 additions and 1 deletions

View File

@ -101,7 +101,7 @@ class PropertyAssignmentAnalyzer
$codebase,
$class_property_type,
$context->self,
null,
$context->self,
$class_storage->parent_class
);
}

View File

@ -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 = [];
}'
]
];
}