@@ -5647,12 +5647,8 @@ static function (): void {
56475647 TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ),
56485648 TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ),
56495649 );
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 ));
56565652 }
56575653 } else {
56585654 $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
@@ -5741,12 +5737,8 @@ static function (): void {
57415737 TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ),
57425738 TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ),
57435739 );
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 ));
57505742 }
57515743 } else {
57525744 $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
0 commit comments