-
-
Notifications
You must be signed in to change notification settings - Fork 947
Nullable parent return type #5529
Copy link
Copy link
Closed
Description
Bug report
On PHPStan 0.12.96, given the following code:
class ParentClass
{}
class HelloWorld extends ParentClass
{
public function run(): ?parent
{
if (rand(0,1)) {
return $this;
}
return null;
}
}produce error:
Internal error: parent type is not supported here Run PHPStan with --debug option and post the stack trace to: https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md
ref https://phpstan.org/r/cde459ea-4602-4078-aef6-ac5fafe6eac1
Expected output
It should not error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels