We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code gets no errors up to v5.25. (The Psalm version on psalm.dev is at time of writing quite old, May 5th, so no problems there)
https://psalm.dev/r/6e53e9fc0c
Starting with v5.26 you get the error Magic instance property FooValue::$foo is not defined on line 56.
Magic instance property FooValue::$foo is not defined
I tracked that down to pull request #11081. Reversing commit 3cf1942 makes things work again, so the problem seems to be there.
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php declare(strict_types=1); abstract class AbstractValue { public function __get(string $name): mixed { return 123; } public function __set(string $name, mixed $value): void { } } /** @property int $foo */ final class FooValue extends AbstractValue { } /** @template T of AbstractValue */ abstract class AbstractClass { /** @var T */ private AbstractValue $value; /** @param T $value */ public function __construct(AbstractValue $value) { $this->value = $value; } /** @return T */ protected function getValue(): AbstractValue { return $this->value; } } /** @extends AbstractClass<FooValue> */ final class Test extends AbstractClass { public function __construct() { parent::__construct(new FooValue()); // Works: echo $this->getValue()->foo; // Works: $v = $this->getValue(); $v->foo = 1; // Fails with: Magic instance property FooValue::$foo is not defined $this->getValue()->foo = 1; } }
Psalm output (using commit 16b24bd): No issues!
Sorry, something went wrong.
No branches or pull requests
The following code gets no errors up to v5.25.
(The Psalm version on psalm.dev is at time of writing quite old, May 5th, so no problems there)
https://psalm.dev/r/6e53e9fc0c
Starting with v5.26 you get the error
Magic instance property FooValue::$foo is not defined
on line 56.I tracked that down to pull request #11081.
Reversing commit 3cf1942 makes things work again, so the problem seems to be there.
The text was updated successfully, but these errors were encountered: