The Hack manual makes it fairly clear how to type-annotate function parameters, function return types, and member variables. However, all of the ways I've tried to type-annotate a global variable or function-local variable result in a syntax error:
string $foo = "foo"; // unexpected T_VARIABLE
$foo : string = "foo"; // unexpected ':'
string $foo; $foo = "foo"; // unexpected T_VARIABLE
$foo : string; $foo = "foo"; // unexpected ':'
Are such annotations possible? If it is possible, then what is the correct syntax? If it is not possible, then is this by design or is it something the developers plan to implement? (It certainly would be useful.)