-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
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
Promoted properties missing in extended __construct should report PropertyNotSetInConstructor #10786
Labels
Comments
I found these snippets: https://psalm.dev/r/b8ed2a83af<?php
class A
{
public function __construct(
public string $name,
public string $foo,
) {}
}
class B extends A
{
public string $bar;
public function __construct(
string $name,
string $foo,
) {}
}
https://psalm.dev/r/83349201cf<?php
class A
{
public int $num;
public function __construct(
public string $name,
public string $foo,
) {
$this->num = rand(0,1);
}
}
class B extends A
{
public function __construct(
string $name,
string $foo,
int $num,
) {}
}
|
Not on lines 15/16 (those are not properties), but yes, |
I found these snippets: https://psalm.dev/r/8b9ddbf888<?php
class A
{
public string $name;
public string $foo;
public function __construct(
string $name,
string $foo,
) {
$this->name = $name;
$this->foo = $foo;
}
}
class B extends A
{
public string $bar;
public function __construct(
string $name,
string $foo,
) {}
}
|
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Mar 13, 2024
…pertyNotSetInConstructor Fix vimeo#10786
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Mar 13, 2024
…pertyNotSetInConstructor Fix vimeo#10786
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/b8ed2a83af
Line 15/16 for $name/$foo should report PropertyNotSetInConstructor too
https://psalm.dev/r/83349201cf
The text was updated successfully, but these errors were encountered: