Open someniatko opened 3 years ago
I found these snippets:
The reason I want to type this, is to make the following work:
/** @var string|null */
$stringOrNull = 'str';
$opt = Option::fromValue($stringOrNull, null);
/** @psalm-trace $opt */
for now @psalm-trace
returns Option<string|null>
, and I'd like to have Option<string>
.
BTW, I found it a bit strange that in the following case no errors are emitted: https://psalm.dev/r/69f073e7a4
I found these snippets:
BTW, I found it a bit strange that in the following case no errors are emitted: https://psalm.dev/r/69f073e7a4
Now there are errors, great!
I found these snippets:
I try to type the following function of
phpoption/phpoption
library: https://psalm.dev/r/1d6b9238daThe problem is, in
Option::fromValue()
I want to specify thatV
template param is notN
. Is it possible to do this? If not, how should I type such a function?Thank you!