@@ -5628,13 +5628,17 @@ static function (): void {
56285628 $ assignedNativeType = $ scope ->getNativeType ($ assignedExpr );
56295629 $ propertyNativeType = $ propertyReflection ->getNativeType ();
56305630
5631- if ($ propertyReflection ->hasNativeType () && $ propertyNativeType ->isNull ()->no ()) {
5632- $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5633- $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5634- }
5631+ if ($ propertyReflection ->hasNativeType ()) {
5632+ if ($ propertyNativeType ->isNull ()->no ()) {
5633+ $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5634+ $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5635+ }
56355636
5636- if ($ propertyReflection ->hasNativeType () && $ scope ->isDeclareStrictTypes ()) {
5637- $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5637+ if ($ scope ->isDeclareStrictTypes ()) {
5638+ $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5639+ } else {
5640+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
5641+ }
56385642 } else {
56395643 $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
56405644 }
@@ -5705,13 +5709,17 @@ static function (): void {
57055709 $ assignedNativeType = $ scope ->getNativeType ($ assignedExpr );
57065710 $ propertyNativeType = $ propertyReflection ->getNativeType ();
57075711
5708- if ($ propertyReflection ->hasNativeType () && $ propertyNativeType ->isNull ()->no ()) {
5709- $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5710- $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5711- }
5712+ if ($ propertyReflection ->hasNativeType ()) {
5713+ if ($ propertyNativeType ->isNull ()->no ()) {
5714+ $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5715+ $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5716+ }
57125717
5713- if ($ propertyReflection ->hasNativeType () && $ scope ->isDeclareStrictTypes ()) {
5714- $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5718+ if ($ scope ->isDeclareStrictTypes ()) {
5719+ $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5720+ } else {
5721+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
5722+ }
57155723 } else {
57165724 $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
57175725 }
0 commit comments