-
-
Notifications
You must be signed in to change notification settings - Fork 947
Integer ranges in array keys do not carry through generics #7087
Copy link
Copy link
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
Expected output
I'd expect integer ranges to be carried through the generics.
Reactions are currently unavailable