Skip to content

Commit 3a211c3

Browse files
authored
Remove legacy -uncurried flag and some leftovers (#8201)
* Remove some uncurried leftovers * Remove legacy -uncurried flag * CHANGELOG
1 parent edd086b commit 3a211c3

8 files changed

Lines changed: 6 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- `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/<module>/` directory is passed. Additionally, stdout and stderr from the post-build command are now logged. https://github.com/rescript-lang/rescript/pull/8190
2222
- `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
2323
- 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
24+
- `bsc`: remove legacy `-uncurried` flag. https://github.com/rescript-lang/rescript/pull/8201
2425

2526
#### :eyeglasses: Spec Compliance
2627

analysis/src/CompletionBackEnd.ml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,17 +1875,14 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens
18751875
->
18761876
if Debug.verbose () then
18771877
print_endline "[complete_typed_value]--> Tfunction #1";
1878-
let shouldPrintAsUncurried = false in
18791878
let mkFnArgs ~asSnippet =
18801879
match args with
1881-
| [(Nolabel, argTyp)] when TypeUtils.typeIsUnit argTyp ->
1882-
if shouldPrintAsUncurried then "(. )" else "()"
1880+
| [(Nolabel, argTyp)] when TypeUtils.typeIsUnit argTyp -> "()"
18831881
| [(Nolabel, argTyp)] ->
18841882
let varName =
18851883
CompletionExpressions.prettyPrintFnTemplateArgName ~env ~full argTyp
18861884
in
1887-
let argsText = if asSnippet then "${1:" ^ varName ^ "}" else varName in
1888-
if shouldPrintAsUncurried then "(. " ^ argsText ^ ")" else argsText
1885+
if asSnippet then "${1:" ^ varName ^ "}" else varName
18891886
| _ ->
18901887
let currentUnlabelledIndex = ref 0 in
18911888
let argsText =
@@ -1908,7 +1905,7 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens
19081905
else varName))
19091906
|> String.concat ", "
19101907
in
1911-
"(" ^ if shouldPrintAsUncurried then ". " else "" ^ argsText ^ ")"
1908+
"(" ^ argsText ^ ")"
19121909
in
19131910
let isAsync =
19141911
match TypeUtils.extractType ~env ~package:full.package returnType with

analysis/src/Packages.ml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ let newBsPackage ~rootPath =
5050
| Some (String suffix) -> suffix
5151
| _ -> ".js"
5252
in
53-
let uncurried =
54-
let ns = config |> Json.get "uncurried" in
55-
match (rescriptVersion, ns) with
56-
| (major, _), None when major >= 11 -> Some true
57-
| _, ns -> Option.bind ns Json.bool
58-
in
5953
let genericJsxModule =
6054
let jsxConfig = config |> Json.get "jsx" in
6155
match jsxConfig with
@@ -87,7 +81,6 @@ let newBsPackage ~rootPath =
8781
| _ -> Misc.StringMap.empty)
8882
| None -> Misc.StringMap.empty
8983
in
90-
let uncurried = uncurried = Some true in
9184
match libBs with
9285
| None -> None
9386
| Some libBs ->
@@ -183,7 +176,6 @@ let newBsPackage ~rootPath =
183176
pathsForModule;
184177
opens;
185178
namespace;
186-
uncurried;
187179
autocomplete;
188180
}))
189181
| None -> None

analysis/src/SharedTypes.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ and completionType =
392392
env: QueryEnv.t;
393393
args: typedFnArg list;
394394
typ: Types.type_expr;
395-
uncurried: bool;
396395
returnType: Types.type_expr;
397396
}
398397

@@ -519,7 +518,6 @@ type package = {
519518
pathsForModule: (file, paths) Hashtbl.t;
520519
namespace: string option;
521520
opens: path list;
522-
uncurried: bool;
523521
rescriptVersion: int * int;
524522
autocomplete: file list Misc.StringMap.t;
525523
}

analysis/src/TypeUtils.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ let rec extractType ?(printOpeningDebug = true)
378378
| Tarrow _ -> (
379379
match extractFunctionType2 ?typeArgContext t ~env ~package with
380380
| args, tRet, typeArgContext when args <> [] ->
381-
Some
382-
( Tfunction {env; args; typ = t; uncurried = false; returnType = tRet},
383-
typeArgContext )
381+
Some (Tfunction {env; args; typ = t; returnType = tRet}, typeArgContext)
384382
| _args, _tRet, _typeArgContext -> None)
385383
| Tconstr (path, typeArgs, _) -> (
386384
if Debug.verbose () then

compiler/bsc/rescript_compiler_main.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array =
371371
clear Clflags.keep_locs,
372372
"*internal* Do not keep locations in .cmi files" );
373373
("-nopervasives", set Clflags.nopervasives, "*internal*");
374-
("-uncurried", unit_call (fun () -> ()), "*internal* deprecated");
375374
( "-v",
376375
unit_call print_version_string,
377376
"Print compiler version and location of standard library and exit" );

tests/build_tests/uncurried-always/rescript.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"sources": {
44
"dir": "src",
55
"subdirs": true
6-
},
7-
"uncurried": true
6+
}
87
}

tests/gentype_tests/typescript-react-example/rescript.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"subdirs": true
2626
}
2727
],
28-
"uncurried": true,
2928
"package-specs": {
3029
"module": "esmodule",
3130
"in-source": true

0 commit comments

Comments
 (0)