Skip to content

Commit fff7deb

Browse files
Fix
1 parent bca49c0 commit fff7deb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 7 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;
@@ -199,6 +200,7 @@
199200
use PHPStan\Type\TypeTraverser;
200201
use PHPStan\Type\TypeUtils;
201202
use PHPStan\Type\UnionType;
203+
use PHPStan\Type\VerbosityLevel;
202204
use ReflectionFunction;
203205
use ReflectionMethod;
204206
use ReflectionProperty;
@@ -6415,7 +6417,11 @@ private function processAssignVar(
64156417
}
64166418

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

0 commit comments

Comments
 (0)