3 type my_shapeA
= shape(?
'x' => arraykey
);
4 type my_shapeB
= shape(?
'x' => int);
9 array<string, arraykey
> $a1,
10 array<string, int> $a2,
14 hh_show(idx($a1, 'x', $b));
15 hh_show(idx($a2, 'x', $a));
16 hh_show(Shapes
::idx($s1, 'x', $b));
17 hh_show(Shapes
::idx($s2, 'x', $a));
19 // Using "wrong" default type will be reported when trying to use the result
20 // in incompatible way
21 return Shapes
::idx($s2, 'x', $a);