Skip to content

Updated array type inference when assigning to empty dimension - now arrays are inferred, not tuples#1079

Merged
romalytvynenko merged 9 commits intomainfrom
1059-bug-complex-jsonresource-not-being-infered
Feb 5, 2026
Merged

Updated array type inference when assigning to empty dimension - now arrays are inferred, not tuples#1079
romalytvynenko merged 9 commits intomainfrom
1059-bug-complex-jsonresource-not-being-infered

Conversation

@romalytvynenko
Copy link
Member

fixes #1059

TL;DR:

Now this code will produce a type of array<42>:

$data = [];
$data[] = 42;
// type of $data?

While obviously in this cast more accurate type will be list{42}, currently more useful is to infer such type as array.

@romalytvynenko romalytvynenko changed the title Changed array type inference from incremental mutations (with empty dimensions) Updated array type inference when assigning to empty dimension - now arrays are inferred, not tuples Feb 5, 2026
@romalytvynenko romalytvynenko merged commit 1788ab6 into main Feb 5, 2026
1 of 17 checks passed
@romalytvynenko romalytvynenko deleted the 1059-bug-complex-jsonresource-not-being-infered branch February 5, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Complex JsonResource not being infered

1 participant