@@ -5556,18 +5556,7 @@ static function (): void {
55565556 $ assignedExprType = $ scope ->getType ($ assignedExpr );
55575557 $ nodeCallback (new PropertyAssignNode ($ var , $ assignedExpr , $ isAssignOp ), $ scope );
55585558 if ($ propertyReflection ->canChangeTypeAfterAssignment ()) {
5559- if ($ propertyReflection ->hasNativeType ()) {
5560- $ propertyNativeType = $ propertyReflection ->getNativeType ();
5561- if ($ propertyNativeType ->isSuperTypeOf ($ assignedExprType )->yes ()) {
5562- $ assignedExprNativeType = $ scope ->getNativeType ($ assignedExpr );
5563- if (!$ propertyNativeType ->isSuperTypeOf ($ assignedExprNativeType )->yes ()) {
5564- $ assignedExprNativeType = $ propertyNativeType ;
5565- }
5566- $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedExprNativeType );
5567- }
5568- } else {
5569- $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
5570- }
5559+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
55715560 }
55725561 $ declaringClass = $ propertyReflection ->getDeclaringClass ();
55735562 if ($ declaringClass ->hasNativeProperty ($ propertyName )) {
@@ -5632,18 +5621,7 @@ static function (): void {
56325621 $ assignedExprType = $ scope ->getType ($ assignedExpr );
56335622 $ nodeCallback (new PropertyAssignNode ($ var , $ assignedExpr , $ isAssignOp ), $ scope );
56345623 if ($ propertyReflection !== null && $ propertyReflection ->canChangeTypeAfterAssignment ()) {
5635- if ($ propertyReflection ->hasNativeType ()) {
5636- $ propertyNativeType = $ propertyReflection ->getNativeType ();
5637- if ($ propertyNativeType ->isSuperTypeOf ($ assignedExprType )->yes ()) {
5638- $ assignedExprNativeType = $ scope ->getNativeType ($ assignedExpr );
5639- if (!$ propertyNativeType ->isSuperTypeOf ($ assignedExprNativeType )->yes ()) {
5640- $ assignedExprNativeType = $ propertyNativeType ;
5641- }
5642- $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedExprNativeType );
5643- }
5644- } else {
5645- $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
5646- }
5624+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ scope ->getNativeType ($ assignedExpr ));
56475625 }
56485626 } else {
56495627 // fallback
0 commit comments