Skip to content

Instantly share code, notes, and snippets.

@andykais
Created January 9, 2017 17:40
Show Gist options
  • Save andykais/14cef14a542f7d0c9a11c7325d6e9b11 to your computer and use it in GitHub Desktop.
Save andykais/14cef14a542f7d0c9a11c7325d6e9b11 to your computer and use it in GitHub Desktop.
yarn run v0.18.1
$ flow; test $? -eq 0 -o $? -eq 2
src/index.js:15
15: let files = await Promise.all(folders.map(async (name) => await listFiles(name)))
^^^^^^^^^^^^^^^^^^^^^ array type. This type is incompatible with
607: declare function $await<T>(p: Promise<T> | T): T;
^^^^^^^^^^^^^^ union: type application of identifier `Promise` | type parameter `T` of async return. See lib: /tmp/flow/flowlib_1ee65d0a/core.js:607
Member 1:
607: declare function $await<T>(p: Promise<T> | T): T;
^^^^^^^^^^ type application of identifier `Promise`. See lib: /tmp/flow/flowlib_1ee65d0a/core.js:607
Error:
15: let files = await Promise.all(folders.map(async (name) => await listFiles(name)))
^^^^^^^^^^^^^^^^^^^^^ array type. This type is incompatible with
607: declare function $await<T>(p: Promise<T> | T): T;
^^^^^^^^^^ Promise. See lib: /tmp/flow/flowlib_1ee65d0a/core.js:607
Member 2:
15: let files = await Promise.all(folders.map(async (name) => await listFiles(name)))
^^^^^^^^^^^^^^^^^^^^^ type parameter `T` of async return
Error:
22: resolve(result.map((file) => path.join(folder, file)))
^^^^^^^^^^^^^^^^^^^^^^^ string. This type is incompatible with. See: src/filesystem.js:22
602: static all<Elem, T:Iterable<Elem>>(promises: T): Promise<$TupleMap<T, typeof $await>>;
^^^^^^^^^^^^^^^^^^^^^^^^^^^ array type. See lib: /tmp/flow/flowlib_1ee65d0a/core.js:602
Found 1 error
Done in 0.13s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment