@@ -5647,12 +5647,8 @@ static function (): void {
5647
5647
TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ),
5648
5648
TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ),
5649
5649
);
5650
- } elseif (!$ propertyNativeType ->isNull ()->no () && $ assignedNativeType ->isNull ()->no ()) {
5651
- $ scope = $ scope ->assignExpression (
5652
- $ var ,
5653
- TypeCombinator::removeNull ($ propertyReflection ->hasPhpDocType () ? $ propertyReflection ->getPhpDocType () : $ propertyNativeType ),
5654
- TypeCombinator::removeNull ($ propertyNativeType ),
5655
- );
5650
+ } else {
5651
+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
5656
5652
}
5657
5653
} else {
5658
5654
$ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
@@ -5741,12 +5737,8 @@ static function (): void {
5741
5737
TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ),
5742
5738
TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ),
5743
5739
);
5744
- } elseif (!$ propertyNativeType ->isNull ()->no () && $ assignedNativeType ->isNull ()->no ()) {
5745
- $ scope = $ scope ->assignExpression (
5746
- $ var ,
5747
- TypeCombinator::removeNull ($ propertyReflection ->hasPhpDocType () ? $ propertyReflection ->getPhpDocType () : $ propertyNativeType ),
5748
- TypeCombinator::removeNull ($ propertyNativeType ),
5749
- );
5740
+ } else {
5741
+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
5750
5742
}
5751
5743
} else {
5752
5744
$ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
0 commit comments