From 90497cc2bb51270b597e963806425b238dc3dc75 Mon Sep 17 00:00:00 2001 From: Steel Brain Date: Fri, 22 Jun 2018 02:53:55 +0500 Subject: [PATCH 1/4] :new: Add flow:main support to package.json --- src/parser_utils/package_json.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser_utils/package_json.ml b/src/parser_utils/package_json.ml index 69adf0793e7..4a4775e275b 100644 --- a/src/parser_utils/package_json.ml +++ b/src/parser_utils/package_json.ml @@ -55,6 +55,7 @@ let parse ast = }) -> begin match key with | "name" -> { package with name = Some value } + | "flow:main" -> { package with main = Some value } | "main" -> { package with main = Some value } | _ -> package end From cfbbaeb8de2212c18d2f2e06c5bc6e627bf7c01f Mon Sep 17 00:00:00 2001 From: Steel Brain Date: Fri, 22 Jun 2018 03:47:33 +0500 Subject: [PATCH 2/4] :bug: flow:main takes precendence --- src/parser_utils/package_json.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser_utils/package_json.ml b/src/parser_utils/package_json.ml index 4a4775e275b..b31abca4960 100644 --- a/src/parser_utils/package_json.ml +++ b/src/parser_utils/package_json.ml @@ -56,7 +56,8 @@ let parse ast = begin match key with | "name" -> { package with name = Some value } | "flow:main" -> { package with main = Some value } - | "main" -> { package with main = Some value } + (* Only use `main` if `flow:main` is not available *) + | "main" when package.main = None -> { package with main = Some value } | _ -> package end | _ -> package From b47afac9208e3d5aca4a098f4aba37f0e5f24b97 Mon Sep 17 00:00:00 2001 From: Steel Brain Date: Fri, 22 Jun 2018 04:12:37 +0500 Subject: [PATCH 3/4] :new: Add new tests for flow:main --- .../node_modules/package_with_dir_flow_main/dir/index.js | 4 ++++ .../package_with_dir_flow_main/dir/index.js.flow.ignored | 4 ++++ .../node_modules/package_with_dir_flow_main/package.json | 3 +++ .../node_modules/package_with_full_flow_main/code.js | 4 ++++ .../package_with_full_flow_main/code.js.flow.ignored | 5 +++++ .../package_with_full_flow_main/package.json | 3 +++ .../node_modules/package_with_partial_flow_main/code.js | 4 ++++ .../package_with_partial_flow_main/code.js.flow.ignored | 2 ++ .../package_with_partial_flow_main/package.json | 2 ++ tests/declaration_files_incremental_node/test.sh | 3 +++ .../declaration_files_incremental_node/test_absolute.js | 9 +++++++++ 11 files changed, 43 insertions(+) create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js.flow.ignored create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/package.json create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js.flow.ignored create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/package.json create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js.flow.ignored create mode 100644 tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/package.json diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js b/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js new file mode 100644 index 00000000000..e620824d773 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js @@ -0,0 +1,4 @@ +/* @flow */ + +class Implementation {} +module.exports.fun = (): Implementation => new Implementation(); diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js.flow.ignored b/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js.flow.ignored new file mode 100644 index 00000000000..e3c8a064db2 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/dir/index.js.flow.ignored @@ -0,0 +1,4 @@ +/* @flow */ + +declare class Definition {} +declare export var fun: () => Definition; diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/package.json b/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/package.json new file mode 100644 index 00000000000..d8e35274e14 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_dir_flow_main/package.json @@ -0,0 +1,3 @@ +{ "name": "package_with_full_main", + "main": "dir-non-existent", + "flow:main": "dir" } diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js b/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js new file mode 100644 index 00000000000..e620824d773 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js @@ -0,0 +1,4 @@ +/* @flow */ + +class Implementation {} +module.exports.fun = (): Implementation => new Implementation(); diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js.flow.ignored b/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js.flow.ignored new file mode 100644 index 00000000000..b752d4915e4 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/code.js.flow.ignored @@ -0,0 +1,5 @@ +/* @flow */ + +declare class Definition {} +declare var fun: () => Definition; +declare export { fun }; diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/package.json b/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/package.json new file mode 100644 index 00000000000..5882bd9e78a --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_full_flow_main/package.json @@ -0,0 +1,3 @@ +{ "name": "package_with_full_main", + "flow:main": "./code.js", + "main": "./code-non-existent.js" } diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js b/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js new file mode 100644 index 00000000000..e620824d773 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js @@ -0,0 +1,4 @@ +/* @flow */ + +class Implementation {} +module.exports.fun = (): Implementation => new Implementation(); diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js.flow.ignored b/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js.flow.ignored new file mode 100644 index 00000000000..fdb61c6f5dc --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/code.js.flow.ignored @@ -0,0 +1,2 @@ +declare class Definition {} +declare export function fun(): Definition; diff --git a/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/package.json b/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/package.json new file mode 100644 index 00000000000..cd8503e61f4 --- /dev/null +++ b/tests/declaration_files_incremental_node/node_modules/package_with_partial_flow_main/package.json @@ -0,0 +1,2 @@ +{ "name": "package_with_partial_main", + "flow:main": "./code" } diff --git a/tests/declaration_files_incremental_node/test.sh b/tests/declaration_files_incremental_node/test.sh index 8ecf0dfc0e3..112ec15f7c6 100755 --- a/tests/declaration_files_incremental_node/test.sh +++ b/tests/declaration_files_incremental_node/test.sh @@ -9,6 +9,9 @@ IMPL_FILES=" node_modules/package_with_full_main/code.js node_modules/package_with_no_package_json/index.js node_modules/package_with_partial_main/code.js + node_modules/package_with_dir_flow_main/dir/index.js + node_modules/package_with_full_flow_main/code.js + node_modules/package_with_partial_flow_main/code.js " DECL_FILES=$(echo "$IMPL_FILES" | sed -e "s/\.js/.js.flow/g") diff --git a/tests/declaration_files_incremental_node/test_absolute.js b/tests/declaration_files_incremental_node/test_absolute.js index ec99b67abe3..767b49646df 100644 --- a/tests/declaration_files_incremental_node/test_absolute.js +++ b/tests/declaration_files_incremental_node/test_absolute.js @@ -39,3 +39,12 @@ var E = require('package_with_no_package_json'); var F = require('package_with_dir_main'); (F.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + +var G = require('package_with_full_flow_main'); +(G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + +var H = require('package_with_partial_flow_main'); +(H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + +var I = require('package_with_dir_flow_main'); +(I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean From 4a7f515873e277515a0b4243b2770ca9a2e371c5 Mon Sep 17 00:00:00 2001 From: Steel Brain Date: Fri, 22 Jun 2018 04:16:48 +0500 Subject: [PATCH 4/4] :arrow_up: Upgrade exp file because of new tests --- .../declaration_files_incremental_node.exp | 477 +++++++++++++++++- 1 file changed, 468 insertions(+), 9 deletions(-) diff --git a/tests/declaration_files_incremental_node/declaration_files_incremental_node.exp b/tests/declaration_files_incremental_node/declaration_files_incremental_node.exp index ec9ff0fe681..0b4ab9a51f3 100644 --- a/tests/declaration_files_incremental_node/declaration_files_incremental_node.exp +++ b/tests/declaration_files_incremental_node/declaration_files_incremental_node.exp @@ -203,6 +203,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Implementation` [1] is incompatible with boolean [2]. @@ -221,7 +272,7 @@ References: -Found 13 errors +Found 16 errors Error --------------------------------------------------------------------------------------------- test_absolute.js:5:2 Cannot cast `B1.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -426,6 +477,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js.flow:4:24 + 4| declare var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js.flow:2:32 + 2| declare export function fun(): Definition; + ^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js.flow:4:31 + 4| declare export var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -444,7 +546,7 @@ References: -Found 13 errors +Found 16 errors Error --------------------------------------------------------------------------------------------- test_absolute.js:5:2 Cannot cast `B1.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. @@ -649,6 +751,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Implementation` [1] is incompatible with boolean [2]. @@ -667,7 +820,7 @@ References: -Found 13 errors +Found 16 errors ======Start off with the .js files and the .flow file====== @@ -875,6 +1028,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js.flow:4:24 + 4| declare var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js.flow:2:32 + 2| declare export function fun(): Definition; + ^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js.flow:4:31 + 4| declare export var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -893,7 +1097,7 @@ References: -Found 13 errors +Found 16 errors Error --------------------------------------------------------------------------------------------- test_absolute.js:5:2 Cannot cast `B1.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. @@ -1098,6 +1302,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Implementation` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js:4:26 + 4| module.exports.fun = (): Implementation => new Implementation(); + ^^^^^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Implementation` [1] is incompatible with boolean [2]. @@ -1116,7 +1371,7 @@ References: -Found 13 errors +Found 16 errors Error --------------------------------------------------------------------------------------------- test_absolute.js:5:2 Cannot cast `B1.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -1321,6 +1576,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js.flow:4:24 + 4| declare var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js.flow:2:32 + 2| declare export function fun(): Definition; + ^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js.flow:4:31 + 4| declare export var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -1339,7 +1645,7 @@ References: -Found 13 errors +Found 16 errors ======Start off without the .js files and with the .flow file====== @@ -1547,6 +1853,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js.flow:4:24 + 4| declare var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js.flow:2:32 + 2| declare export function fun(): Definition; + ^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js.flow:4:31 + 4| declare export var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -1565,7 +1922,7 @@ References: -Found 13 errors +Found 16 errors Error --------------------------------------------------------------------------------------------- test_absolute.js:5:2 Cannot cast `B1.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -1770,6 +2127,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js.flow:4:24 + 4| declare var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js.flow:2:32 + 2| declare export function fun(): Definition; + ^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js.flow:4:31 + 4| declare export var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -1788,7 +2196,7 @@ References: -Found 13 errors +Found 16 errors Error --------------------------------------------------------------------------------------------- test_absolute.js:5:2 Cannot cast `B1.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -1993,6 +2401,57 @@ References: ^^^^^^^ [2] +Error -------------------------------------------------------------------------------------------- test_absolute.js:44:2 + +Cannot cast `G.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:44:2 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_full_flow_main/code.js.flow:4:24 + 4| declare var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:44:11 + 44| (G.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:47:2 + +Cannot cast `H.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:47:2 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_partial_flow_main/code.js.flow:2:32 + 2| declare export function fun(): Definition; + ^^^^^^^^^^ [1] + test_absolute.js:47:11 + 47| (H.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- test_absolute.js:50:2 + +Cannot cast `I.fun()` to boolean because `Definition` [1] is incompatible with boolean [2]. + + test_absolute.js:50:2 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ + +References: + node_modules/package_with_dir_flow_main/dir/index.js.flow:4:31 + 4| declare export var fun: () => Definition; + ^^^^^^^^^^ [1] + test_absolute.js:50:11 + 50| (I.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean + ^^^^^^^ [2] + + Error --------------------------------------------------------------------------------------------- test_relative.js:3:2 Cannot cast `foo()` to boolean because `Definition` [1] is incompatible with boolean [2]. @@ -2011,4 +2470,4 @@ References: -Found 13 errors +Found 16 errors