hh_client 报告包错误

2024-03-24

我正在按照中的说明进行操作入门 https://docs.hhvm.com/hack/getting-started/starting-a-real-project在 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 软件包有关。

为什么???


最近的 Hack 类型检查器(从 HHVM 4.62 开始 https://hhvm.com/blog/2020/06/16/hhvm-4.62.html)将 HH_FIXME 注释中的错误代码从“默认允许”更改为“默认禁止”。

尝试将其添加到您的.hhconfig:

allowed_fixme_codes_strict = 2050, 4110
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

hh_client 报告包错误 的相关文章

随机推荐