diff --git a/flow_parser.opam b/flow_parser.opam index e499f75a20f..0e25620aaa6 100644 --- a/flow_parser.opam +++ b/flow_parser.opam @@ -9,7 +9,7 @@ license: "MIT" build: ["dune" "build" "-p" name "-j" jobs] depends: [ - "ocaml" {>= "5.2.0"} + "ocaml" {>= "4.14.0"} "dune" {>= "3.2"} "base" {>= "v0.16.3"} "ppxlib" {>= "0.32.1"} diff --git a/flowtype.opam b/flowtype.opam index 20458d492d2..11d4a5ecfa1 100644 --- a/flowtype.opam +++ b/flowtype.opam @@ -8,7 +8,7 @@ homepage: "https://flow.org" doc: "https://flow.org/en/docs/getting-started/" bug-reports: "https://github.com/facebook/flow/issues" depends: [ - "ocaml" {>= "5.2.0"} + "ocaml" {>= "4.14.0"} "base" {>= "v0.16.3"} "base-unix" "base-bytes" diff --git a/src/parser/parser_common.ml b/src/parser/parser_common.ml index e651749946a..ad67acf6a81 100644 --- a/src/parser/parser_common.ml +++ b/src/parser/parser_common.ml @@ -519,7 +519,7 @@ let is_start_of_type_guard env = let reparse_arguments_as_match_argument env (args_loc, args) = let { Expression.ArgList.arguments; _ } = args in - if List.is_empty arguments then Parser_env.error_at env (args_loc, Parse_error.MatchEmptyArgument); + if Base.List.is_empty arguments then Parser_env.error_at env (args_loc, Parse_error.MatchEmptyArgument); let filtered_args = List.filter_map (function diff --git a/src/third-party/sedlex-ppx/ppx_sedlex.ml b/src/third-party/sedlex-ppx/ppx_sedlex.ml index 44c063e7fe9..80f0db4bfcb 100644 --- a/src/third-party/sedlex-ppx/ppx_sedlex.ml +++ b/src/third-party/sedlex-ppx/ppx_sedlex.ml @@ -4,6 +4,7 @@ open Ppxlib open Ast_builder.Default +open Ast_helper (* let ocaml_version = Versions.ocaml_408 *) @@ -359,7 +360,14 @@ let gen_state lexbuf auto i (trans, final) = (appfun (partition_name partition) [[%expr Sedlexing.__private__next_int [%e evar ~loc lexbuf]]]) (cases @ [case ~lhs:[%pat? _] ~guard:None ~rhs:[%expr Sedlexing.backtrack [%e evar ~loc lexbuf]]]) in - let ret body = [ value_binding ~loc ~pat:(pvar ~loc (state_fun i)) ~expr:(pexp_function ~loc [case ~lhs:(pvar ~loc lexbuf) ~guard:None ~rhs:body]) ] in + let ret body = + let lhs = pvar ~loc lexbuf in + [ + value_binding ~loc + ~pat:(pvar ~loc (state_fun i)) + ~expr:(Exp.fun_ ~loc Nolabel None lhs body); + ] + in match best_final final with | None -> ret (body ()) | Some _ when Array.length trans = 0 -> [] diff --git a/tests/long_directory_names/.testconfig b/tests/long_directory_names/.testconfig deleted file mode 100644 index 9bfaf8ba1d7..00000000000 --- a/tests/long_directory_names/.testconfig +++ /dev/null @@ -1,2 +0,0 @@ -auto_start: false -shell: test.sh diff --git a/tests/long_directory_names/long_directory_names.exp b/tests/long_directory_names/long_directory_names.exp deleted file mode 100644 index 50a1adcd5ca..00000000000 --- a/tests/long_directory_names/long_directory_names.exp +++ /dev/null @@ -1,36 +0,0 @@ - -Flow check: -Error ------------------------------------------------------------------------------------------------------ foo.js:3:17 - -Cannot assign `123` to `x` because number [1] is incompatible with string [2]. [incompatible-type] - - foo.js:3:17 - 3| let x: string = 123 - ^^^ [1] - -References: - foo.js:3:8 - 3| let x: string = 123 - ^^^^^^ [2] - - - -Found 1 error - -Flow status: -Error ------------------------------------------------------------------------------------------------------ foo.js:3:17 - -Cannot assign `123` to `x` because number [1] is incompatible with string [2]. [incompatible-type] - - foo.js:3:17 - 3| let x: string = 123 - ^^^ [1] - -References: - foo.js:3:8 - 3| let x: string = 123 - ^^^^^^ [2] - - - -Found 1 error diff --git a/tests/long_directory_names/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/.flowconfig b/tests/long_directory_names/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/.flowconfig deleted file mode 100644 index a46021e83c3..00000000000 --- a/tests/long_directory_names/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/.flowconfig +++ /dev/null @@ -1,13 +0,0 @@ -[ignore] - -[include] - -[libs] - -[lints] - -[options] -all=true -exact_by_default=false - -[strict] diff --git a/tests/long_directory_names/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/foo.js b/tests/long_directory_names/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/foo.js deleted file mode 100644 index 439a3707014..00000000000 --- a/tests/long_directory_names/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/foo.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow - -let x: string = 123 diff --git a/tests/long_directory_names/test.sh b/tests/long_directory_names/test.sh deleted file mode 100644 index 926def6ca87..00000000000 --- a/tests/long_directory_names/test.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# Hopefully this will be short enough not to upset windows CI -LONG_PATH="really_long_path/really_long_path/really_long_path/really_long_path/\ -really_long_path/really_long_path/really_long_path/really_long_path/\ -really_long_path/really_long_path/really_long_path" - -printf "\nFlow check:\n" -assert_errors "$FLOW" check --strip-root "$LONG_PATH" - -printf "\nFlow status:\n" -start_flow "$LONG_PATH" -assert_errors "$FLOW" status --strip-root --no-auto-start "$LONG_PATH" -assert_ok "$FLOW" stop "$LONG_PATH"