1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Carry over ignore_nullable_issues when combining/simplifying types

This commit is contained in:
Matt Brown 2017-05-10 13:36:05 -04:00
parent cadaef14e6
commit f73fc7c6eb
2 changed files with 6 additions and 0 deletions

View File

@ -1231,6 +1231,7 @@ class TypeChecker
}
$from_docblock = $union->from_docblock;
$ignore_nullable_issues = $union->ignore_nullable_issues;
$unique_types = [];
@ -1267,6 +1268,7 @@ class TypeChecker
$unique_type = new Type\Union($unique_types);
$unique_type->from_docblock = $from_docblock;
$unique_type->ignore_nullable_issues = $ignore_nullable_issues;
return $unique_type;
}

View File

@ -465,6 +465,10 @@ abstract class Type
$combined_type->from_docblock = true;
}
if ($type_1->ignore_nullable_issues || $type_2->ignore_nullable_issues) {
$combined_type->ignore_nullable_issues = true;
}
if ($both_failed_reconciliation) {
$combined_type->failed_reconciliation = true;
}