Closed Ocramius closed 1 year ago
I found these snippets:
I've just seen how those code locations call TypeCombiner::combine()
with an explicit $literal_limit
.
Would it make sense to omit the argument there, and leave whichever healthy default in the TypeCombiner::combine()
is in use? The default is 500
items, at the moment.
We could try to do a PR with that. My main fear is performance, especially because we don't have tests to check performance so we wouldn't catch it. But go ahead, let's see if there's a notable change with Psalm itself
Take following example @ https://psalm.dev/r/7158d77465 :
While Psalm correctly understands
$value
being aLargeUnion
, it gives up in the$input = [$value => 'foo'];
expression, which becomes anon-empty-array<int<0, max>, 'foo'>
:The
maxShapedArraySize="1000"
configuration does not seem to help here either.Reducing to less than
30
constants fixes the problem ( https://psalm.dev/r/c17fe8ddca ) , making it a look for30
in the codebase:I found some relevant code references: