@@ -5556,18 +5556,7 @@ static function (): void {
5556
5556
$ assignedExprType = $ scope ->getType ($ assignedExpr );
5557
5557
$ nodeCallback (new PropertyAssignNode ($ var , $ assignedExpr , $ isAssignOp ), $ scope );
5558
5558
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 ));
5571
5560
}
5572
5561
$ declaringClass = $ propertyReflection ->getDeclaringClass ();
5573
5562
if ($ declaringClass ->hasNativeProperty ($ propertyName )) {
@@ -5632,18 +5621,7 @@ static function (): void {
5632
5621
$ assignedExprType = $ scope ->getType ($ assignedExpr );
5633
5622
$ nodeCallback (new PropertyAssignNode ($ var , $ assignedExpr , $ isAssignOp ), $ scope );
5634
5623
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 ));
5647
5625
}
5648
5626
} else {
5649
5627
// fallback
0 commit comments