https://psalm.dev/r/8b57f1708d
```php
y = $y;
}
}
class Y extends X {
public function __construct(string $y)
{
if ($y === 'a' || $y === 'b' || $y === 'c') {
parent::__construct($y);
} else {
throw new InvalidArgumentException();
}
}
}
class Z extends X {
public function __construct(string $y)
{
switch ($y) {
case 'a':
case 'b':
case 'c':
parent::__construct($y);
return;
default:
throw new InvalidArgumentException();
}
}
}
class ZZ extends X {
public function __construct(string $y)
{
match ($y) {
'a', 'b', 'c' => parent::__construct($y),
default => throw new InvalidArgumentException()
};
}
}
```
```
Psalm output (using commit 03ee02c):
ERROR: PropertyNotSetInConstructor - 23:7 - Property Z::$y is not defined in constructor of Z or in any methods called in the constructor
ERROR: PropertyNotSetInConstructor - 38:7 - Property ZZ::$y is not defined in constructor of ZZ or in any methods called in the constructor
```
https://psalm.dev/r/8b57f1708d
Exhaustive matches and switches are not detected properly, causing
PropertyNotSetInConstructor
in this example