Skip to content

Commit e847793

Browse files
committed
coerce native/non-native both or none
1 parent 60a29fa commit e847793

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: src/Analyser/NodeScopeResolver.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -5630,12 +5630,9 @@ static function (): void {
56305630
$propertyNativeType = $propertyReflection->getNativeType();
56315631

56325632
$newAssignedType = TypeCombinator::intersect($assignedExprType, $propertyNativeType);
5633-
if ($newAssignedType instanceof NeverType) {
5634-
$newAssignedType = TypeCombinator::intersect($assignedExprType->toCoercedArgumentType(true), $propertyNativeType);
5635-
}
5636-
56375633
$newAssignedNativeType = TypeCombinator::intersect($assignedNativeType, $propertyNativeType);
5638-
if ($newAssignedNativeType instanceof NeverType) {
5634+
if ($newAssignedType instanceof NeverType || $newAssignedNativeType instanceof NeverType) {
5635+
$newAssignedType = TypeCombinator::intersect($assignedExprType->toCoercedArgumentType(true), $propertyNativeType);
56395636
$newAssignedNativeType = TypeCombinator::intersect($assignedNativeType->toCoercedArgumentType(true), $propertyNativeType);
56405637
}
56415638

0 commit comments

Comments
 (0)