我正在按照 Getting started 中的说明进行操作在官方 Hacklang 网站上。
正如它所说,我运行:
$ touch .hhconfig
$ mkdir bin src tests
$ cat > hh_autoload.json
{
"roots": [
"src/"
],
"devRoots": [
"tests/"
],
"devFailureHandler": "Facebook\\AutoloadMap\\HHClientFallbackHandler"
}
$ composer require hhvm/hsl hhvm/hhvm-autoload
然后我运行 hh_client
,这会引发 74 个错误,如下所示:Typing[4110] You cannot use HH_FIXME or HH_IGNORE_ERROR comments to suppress error 4110
--> vendor/autoload.hack
318 | \HH\autoload_set_paths(/* HH_FIXME[4110] incorrect hhi */ $map, Generated\root());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Typing[4110] Invalid argument
--> vendor/autoload.hack
318 | \HH\autoload_set_paths(/* HH_FIXME[4110] incorrect hhi */ $map, Generated\root());
| ^^^^
--> /private/tmp/hh_server/hhi_3f14b466/functions.hhi
82 | KeyedContainer<string, KeyedContainer<string, string>> $map,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected KeyedContainer<string, string>
--> vendor/hhvm/hhvm-autoload/src/FailureHandler.hack
46 | final public function handleFailure(string $kind, string $name): void {
| ^^^^^^^^^^^^^ But got (function(string $kind, string $name): void)
Naming[2050] You cannot use HH_FIXME or HH_IGNORE_ERROR comments to suppress error 2050
--> vendor/bin/hh-autoload.hack
179 | GenerateScript::main(vec(/* HH_IGNORE_ERROR[2050] */ $GLOBALS['argv']));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
...
这些错误与通过 composer 安装的 hh_autoload 和 hsl 包有关。为什么???
最佳答案
HH_FIXME 注释中的错误代码的 Hack typechecker 最近( as of HHVM 4.62 )从“默认允许”更改为“默认禁止”。
尝试将此添加到您的 .hhconfig
:
allowed_fixme_codes_strict = 2050, 4110
关于composer-php - hh_client 报告包错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62978039/