Skip to content

Commit 37e7d16

Browse files
Fix
1 parent bca49c0 commit 37e7d16

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
use PHPStan\Type\Constant\ConstantIntegerType;
175175
use PHPStan\Type\Constant\ConstantStringType;
176176
use PHPStan\Type\ConstantTypeHelper;
177+
use PHPStan\Type\ErrorType;
177178
use PHPStan\Type\FileTypeMapper;
178179
use PHPStan\Type\GeneralizePrecision;
179180
use PHPStan\Type\Generic\TemplateTypeHelper;
@@ -6415,7 +6416,11 @@ private function processAssignVar(
64156416
}
64166417

64176418
$setVarType = $scope->getType($originalVar->var);
6418-
if (!$setVarType->isArray()->yes() && !(new ObjectType(ArrayAccess::class))->isSuperTypeOf($setVarType)->no()) {
6419+
if (
6420+
!$setVarType instanceof ErrorType
6421+
&& !$setVarType->isArray()->yes()
6422+
&& !(new ObjectType(ArrayAccess::class))->isSuperTypeOf($setVarType)->no()
6423+
) {
64196424
$throwPoints = array_merge($throwPoints, $this->processExprNode(
64206425
$stmt,
64216426
new MethodCall($originalVar->var, 'offsetSet'),

0 commit comments

Comments
 (0)