Skip to content
Permalink
Browse files

Explicitly mixed properties need not be initialised

  • Loading branch information...
muglug committed Aug 11, 2019
1 parent 7c6b158 commit fac7df2ee0b8e836695bdef54ff64805dee197af
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/Psalm/Internal/Analyzer/ClassAnalyzer.php
@@ -678,14 +678,19 @@ public function analyze(
if ($property_storage->type) {
$property_type = clone $property_storage->type;
if (!$property_type->isMixed()
&& !$property_storage->has_default
&& !($property_type->isNullable() && $property_type->from_docblock)
) {
$property_type->initialized = false;
}
} else {
$property_type = Type::getMixed();
}
if (!$property_storage->has_default
&& !($property_type->isNullable() && $property_type->from_docblock)
) {
$property_type->initialized = false;
if (!$property_storage->has_default) {
$property_type->initialized = false;
}
}
$property_type_location = $property_storage->type_location;

0 comments on commit fac7df2

Please sign in to comment.
You can’t perform that action at this time.