In my desperate attempts to type a line with $data assignment in the following code https://psalm.dev/r/c73a7e3d1c
<?php
/** @var mixed $data */
$data = 42;
$arr = [];
/** @var array{k: mixed} */
$arr['k'] = $data;
echo count($arr);
I accidentally found that an "incomplete" (not sure it's a thing, I could not find any references to it) @var notation works for that code.
While a "complete" version does not: /** @var array{k: mixed} $arr */
I believe the "complete" notation should work in this case.
And should the "short" one even be valid?
The short one should be valid - at least, it鈥檚 used a lot in the wild (though some linters prevent it). But the long version should also work, and that鈥檚 a bug.
This also works (no spaces): https://psalm.dev/r/69ce009611
This appears to work now