Hacklang: How do I type-annotate a local/global variable? -


the hack manual makes clear how type-annotate function parameters, function return types, , member variables. however, of ways i've tried type-annotate global variable or function-local variable result in 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 possible, correct syntax? if not possible, design or developers plan implement? (it useful.)

it's not possible, , design.

local variables have types inferred, , global variables don't type checked (as can changed @ time anywhere accesing $_globals).

if there's particular page of documentation make clearer, please click "file documentation bug" link @ bottom of it, can added.


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -