-
Notifications
You must be signed in to change notification settings - Fork 686
Closed
Labels
Description
I could not find any similar issue. I have a usecase
<?php
/**
* @template T
*
* @psalm-param string|null $nullable
* @psalm-param T $exception
*
* @psalm-throws T
*/
function expect(?string $nullable, Exception $exception)
{
if ($nullable === null) {
throw $exception;
}
return $nullable;
}
expect('test', new RuntimeException('Test is null'));
My proposal:
@psalm-throws
should take generic parameter same as @psalm-param
or @psalm-var
.
awd-studio, rejinka and jmglsn