-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Description
Bug report
Using 1.5.7.
In the below example link, I created two methods (foo and bar) that accept an array parameter. foo declares an explicit return of array<int<0,max>, mixed>, whereas bar uses generics to simply pass through the input type. The class has two properties, array1 and array2 that both expect array<int<0,max>, mixed>. The result of foo can be successfully assigned to a property, but the result of bar cannot. It would seem the generics I used for bar do not carry through the integer range int<0,max> for keys. It comes out as simply int.
Or I'm using generics incorrectly?
Code snippet that reproduces the problem
https://phpstan.org/r/e9901d5a-abb7-47ba-8706-204c3890a6fb
Expected output
I'd expect integer ranges to be carried through the generics.
Reactions are currently unavailable