hack-json-schema icon indicating copy to clipboard operation
hack-json-schema copied to clipboard

Readme contains code that does not typecheck

Open lexidor opened this issue 5 years ago • 0 comments

use type Slack\Hack\JsonSchema\Codegen\Codegen;

$schemas = vec['/path/to/json-schema-1.json', '/path/to/json-schema-2.json', '/path/to/json-schema-3.json'];
Codegen::forPaths($schemas, shape(
  'validator' => shape(
    'refs' => shape(
       'unique' => shape(
          'source_root' => '/path/to',
          'output_root' => '/path/gen'
        )
     )
  ),
))->build();
Typing[4053] No method 'build' in vec
   --> file.hack
 19 |   ))->build();
    |       ^^^^^
   --> vendor/slack/hack-json-schema/src/Codegen/Codegen.php
123 |   ): vec<Codegen> {
    |      ^^^^^^^^^^^^ This is why I think it is an object of type vec
   --> /tmp/hh_server/hhi_356191d8/hackarray.hhi
 13 | abstract final class vec<+T> implements KeyedContainer<int, T>, XHPChild {}
    |                      ^^^ Declaration of vec is here

1 error found.

lexidor avatar Oct 18 '19 20:10 lexidor