<?hh
type PointA<T> = shape ('x' => T, 'y' => T);
function demo1(PointA<T> $pt1){}
// do stufff - general case
type PointB<int> = shape ('x' => int, 'y' => int);
function demo2(PointB<int> $pt1) {}
// special case for Point of type int only
type PointC = shape('x' => int, 'y' => 0);
function demo3(PointC<int> $pt1) {}
// special case for Point of type int where y is 0
<?hh
type PointA<T> = shape ('x' => T, 'y' => T);
function demo1(PointA<T> $pt1){}
// do stufff - general case
type PointB<int> = shape ('x' => int, 'y' => int);
function demo2(PointB<int> $pt1) {}
// special case for Point of type int only
type PointC = shape('x' => int, 'y' => 0);
function demo3(PointC<int> $pt1) {}
// special case for Point of type int where y is 0
Output for 8.0.13
Parse error: syntax error, unexpected identifier "type" in /in/uQfEZ on line 3
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Parse error: syntax error, unexpected 'type' (T_STRING) in /in/uQfEZ on line 3
Process exited with code 255.