hh_client reports errors on package

时光怂恿深爱的人放手 提交于 2021-01-27 07:46:10

问题


I am following the instruction in Getting started on official Hacklang website.

As it says, I run:

$ 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

Then I run hh_client, which throws 74 errors like those:

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']));
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^

...

Those errors are related to hh_autoload and hsl package installed through composer.

Why is it???


回答1:


The Hack typechecker recently (as of HHVM 4.62) changed from 'allow by default' to 'ban by default' for error codes in HH_FIXME comments.

Try adding this to your .hhconfig:

allowed_fixme_codes_strict = 2050, 4110


来源:https://stackoverflow.com/questions/62978039/hh-client-reports-errors-on-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!