Last active
November 12, 2015 14:42
-
-
Save daviddoran/1090ebea9bbaec6a3f15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?hh // strict | |
namespace Hack\UserDocumentation\TypeChecker\Modes\Examples\CallIntoDecl; | |
require __DIR__ . '/decl.inc.php'; | |
// This actually makes the call to calling_into_decl() since we cannot have | |
// top level functions in strict mode | |
require __DIR__ . '/main-function.inc.php'; | |
// use \Hack\UserDocumentation\TypeChecker\Modes\Examples\Decl as Decl; | |
function calling_into_decl(): string { | |
// If php_func wasn't in decl mode, then we would get an unbound name error. | |
// As it is, we can call this function and the typechecker will ensure we are | |
// passing in the right number of arguments, but not the types of them. | |
return \Hack\UserDocumentation\TypeChecker\Modes\Examples\Decl\php_func("a", "b"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment