Closed designermonkey closed 7 months ago
Describe the bug
When I use the code below, intelephense tells me that the $clone variable is Expected type 'object'. Found 'string'. intelephense(1006).
$clone
Expected type 'object'. Found 'string'. intelephense(1006)
I don't understand how that can be the case unless I've missed something obvious.
To Reproduce
public function withFields(Fields $fields): self { $reflection = new ReflectionClass(static::class); $scope = $reflection->getProperty('fields')->getDeclaringClass()->getName(); $clone = $reflection->newInstanceWithoutConstructor(); if (self::class === $scope) { $clone->fields = $fields; } return $this; }
Expected behavior
That there is no error.
Screenshots
Platform and version
Mac OS Ventura 13.3, Code 1.77.0 and Intelephense v1.9.5
Can't repro in 1.10.4
Describe the bug
When I use the code below, intelephense tells me that the
$clone
variable isExpected type 'object'. Found 'string'. intelephense(1006)
.I don't understand how that can be the case unless I've missed something obvious.
To Reproduce
Expected behavior
That there is no error.
Screenshots
Platform and version
Mac OS Ventura 13.3, Code 1.77.0 and Intelephense v1.9.5