diff --git a/CHANGELOG.md b/CHANGELOG.md index da2eca3e3e..929bc593da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - `js-post-build` now passes the correct output file path based on `in-source` configuration: when `in-source: true`, the path next to the source file is passed; when `in-source: false`, the path in the `lib//` directory is passed. Additionally, stdout and stderr from the post-build command are now logged. https://github.com/rescript-lang/rescript/pull/8190 - `js-post-build` command now runs in the directory containing the `rescript.json` where it is defined, instead of the unpredictable build invocation directory. This provides consistent behavior in monorepos. https://github.com/rescript-lang/rescript/pull/8195 - Remove support for deprecated `bs-dependencies`, `bs-dev-dependencies`, and `bsc-flags` configuration options. Use `dependencies`, `dev-dependencies`, and `compiler-flags` instead. https://github.com/rescript-lang/rescript/pull/8196 +- `bsc`: remove legacy `-uncurried` flag. https://github.com/rescript-lang/rescript/pull/8201 #### :eyeglasses: Spec Compliance diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index a24b4315fb..d6ac8fb4ea 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -1875,17 +1875,14 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens -> if Debug.verbose () then print_endline "[complete_typed_value]--> Tfunction #1"; - let shouldPrintAsUncurried = false in let mkFnArgs ~asSnippet = match args with - | [(Nolabel, argTyp)] when TypeUtils.typeIsUnit argTyp -> - if shouldPrintAsUncurried then "(. )" else "()" + | [(Nolabel, argTyp)] when TypeUtils.typeIsUnit argTyp -> "()" | [(Nolabel, argTyp)] -> let varName = CompletionExpressions.prettyPrintFnTemplateArgName ~env ~full argTyp in - let argsText = if asSnippet then "${1:" ^ varName ^ "}" else varName in - if shouldPrintAsUncurried then "(. " ^ argsText ^ ")" else argsText + if asSnippet then "${1:" ^ varName ^ "}" else varName | _ -> let currentUnlabelledIndex = ref 0 in let argsText = @@ -1908,7 +1905,7 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens else varName)) |> String.concat ", " in - "(" ^ if shouldPrintAsUncurried then ". " else "" ^ argsText ^ ")" + "(" ^ argsText ^ ")" in let isAsync = match TypeUtils.extractType ~env ~package:full.package returnType with diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 9b13b76a52..8852119d17 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -50,12 +50,6 @@ let newBsPackage ~rootPath = | Some (String suffix) -> suffix | _ -> ".js" in - let uncurried = - let ns = config |> Json.get "uncurried" in - match (rescriptVersion, ns) with - | (major, _), None when major >= 11 -> Some true - | _, ns -> Option.bind ns Json.bool - in let genericJsxModule = let jsxConfig = config |> Json.get "jsx" in match jsxConfig with @@ -87,7 +81,6 @@ let newBsPackage ~rootPath = | _ -> Misc.StringMap.empty) | None -> Misc.StringMap.empty in - let uncurried = uncurried = Some true in match libBs with | None -> None | Some libBs -> @@ -183,7 +176,6 @@ let newBsPackage ~rootPath = pathsForModule; opens; namespace; - uncurried; autocomplete; })) | None -> None diff --git a/analysis/src/SharedTypes.ml b/analysis/src/SharedTypes.ml index b44fa53a3e..49752aebf4 100644 --- a/analysis/src/SharedTypes.ml +++ b/analysis/src/SharedTypes.ml @@ -392,7 +392,6 @@ and completionType = env: QueryEnv.t; args: typedFnArg list; typ: Types.type_expr; - uncurried: bool; returnType: Types.type_expr; } @@ -519,7 +518,6 @@ type package = { pathsForModule: (file, paths) Hashtbl.t; namespace: string option; opens: path list; - uncurried: bool; rescriptVersion: int * int; autocomplete: file list Misc.StringMap.t; } diff --git a/analysis/src/TypeUtils.ml b/analysis/src/TypeUtils.ml index 479ebcd2a9..466d2f8bcf 100644 --- a/analysis/src/TypeUtils.ml +++ b/analysis/src/TypeUtils.ml @@ -378,9 +378,7 @@ let rec extractType ?(printOpeningDebug = true) | Tarrow _ -> ( match extractFunctionType2 ?typeArgContext t ~env ~package with | args, tRet, typeArgContext when args <> [] -> - Some - ( Tfunction {env; args; typ = t; uncurried = false; returnType = tRet}, - typeArgContext ) + Some (Tfunction {env; args; typ = t; returnType = tRet}, typeArgContext) | _args, _tRet, _typeArgContext -> None) | Tconstr (path, typeArgs, _) -> ( if Debug.verbose () then diff --git a/compiler/bsc/rescript_compiler_main.ml b/compiler/bsc/rescript_compiler_main.ml index ec40263bb6..8d4113cebd 100644 --- a/compiler/bsc/rescript_compiler_main.ml +++ b/compiler/bsc/rescript_compiler_main.ml @@ -371,7 +371,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array = clear Clflags.keep_locs, "*internal* Do not keep locations in .cmi files" ); ("-nopervasives", set Clflags.nopervasives, "*internal*"); - ("-uncurried", unit_call (fun () -> ()), "*internal* deprecated"); ( "-v", unit_call print_version_string, "Print compiler version and location of standard library and exit" ); diff --git a/tests/build_tests/uncurried-always/rescript.json b/tests/build_tests/uncurried-always/rescript.json index 1d33814204..90fd7186f8 100644 --- a/tests/build_tests/uncurried-always/rescript.json +++ b/tests/build_tests/uncurried-always/rescript.json @@ -3,6 +3,5 @@ "sources": { "dir": "src", "subdirs": true - }, - "uncurried": true + } } diff --git a/tests/gentype_tests/typescript-react-example/rescript.json b/tests/gentype_tests/typescript-react-example/rescript.json index bde1f40eb8..00ecbd68ba 100644 --- a/tests/gentype_tests/typescript-react-example/rescript.json +++ b/tests/gentype_tests/typescript-react-example/rescript.json @@ -25,7 +25,6 @@ "subdirs": true } ], - "uncurried": true, "package-specs": { "module": "esmodule", "in-source": true