From 8a29575b189b308b3806267e08a4d4d67a196622 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 4 Jan 2025 23:10:39 +0100 Subject: [PATCH 1/3] fix issue where type arg ctx was not passed along properly for inline recordds --- analysis/src/TypeUtils.ml | 7 ++++--- tests/analysis_tests/tests/package-lock.json | 1 + tests/analysis_tests/tests/src/Support.res | 4 ++++ tests/analysis_tests/tests/src/TypeArgCtx.res | 9 +++++++++ .../tests/src/expected/Completion.res.txt | 10 ++++++++++ .../src/expected/CompletionJsxProps.res.txt | 10 ++++++++++ .../tests/src/expected/Support.res.txt | 0 .../tests/src/expected/TypeArgCtx.res.txt | 19 +++++++++++++++++++ 8 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 tests/analysis_tests/tests/src/Support.res create mode 100644 tests/analysis_tests/tests/src/TypeArgCtx.res create mode 100644 tests/analysis_tests/tests/src/expected/Support.res.txt create mode 100644 tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt diff --git a/analysis/src/TypeUtils.ml b/analysis/src/TypeUtils.ml index 6f476e8356..491df9accb 100644 --- a/analysis/src/TypeUtils.ml +++ b/analysis/src/TypeUtils.ml @@ -646,7 +646,7 @@ let rec resolveNested ?typeArgContext ~env ~full ~nested ?ctx Toption (env, ExtractedType typ) ) -> if Debug.verbose () then print_endline "[nested]--> moving into option Some"; - typ |> resolveNested ~env ~full ~nested + typ |> resolveNested ?typeArgContext ~env ~full ~nested | ( NVariantPayload {constructorName = "Some"; itemNum = 0}, Toption (env, TypeExpr typ) ) -> if Debug.verbose () then @@ -706,7 +706,8 @@ let rec resolveNested ?typeArgContext ~env ~full ~nested ?ctx | Some {args = InlineRecord fields} when itemNum = 0 -> if Debug.verbose () then print_endline "[nested]--> found constructor (inline record)"; - TinlineRecord {env; fields} |> resolveNested ~env ~full ~nested + TinlineRecord {env; fields} + |> resolveNested ?typeArgContext ~env ~full ~nested | _ -> None) | ( NPolyvariantPayload {constructorName; itemNum}, Tpolyvariant {env; constructors} ) -> ( @@ -725,7 +726,7 @@ let rec resolveNested ?typeArgContext ~env ~full ~nested ?ctx |> Utils.Option.flatMap (fun (typ, typeArgContext) -> typ |> resolveNested ?typeArgContext ~env ~full ~nested))) | NArray, Tarray (env, ExtractedType typ) -> - typ |> resolveNested ~env ~full ~nested + typ |> resolveNested ?typeArgContext ~env ~full ~nested | NArray, Tarray (env, TypeExpr typ) -> typ |> extractType ~env ~package:full.package diff --git a/tests/analysis_tests/tests/package-lock.json b/tests/analysis_tests/tests/package-lock.json index 7a51892b94..775904830a 100644 --- a/tests/analysis_tests/tests/package-lock.json +++ b/tests/analysis_tests/tests/package-lock.json @@ -33,6 +33,7 @@ } }, "../../..": { + "name": "rescript", "version": "12.0.0-alpha.7", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", diff --git a/tests/analysis_tests/tests/src/Support.res b/tests/analysis_tests/tests/src/Support.res new file mode 100644 index 0000000000..a0ce4ef412 --- /dev/null +++ b/tests/analysis_tests/tests/src/Support.res @@ -0,0 +1,4 @@ +module CatchResult = { + @tag("ok") + type t<'value> = | @as(true) Ok({value: 'value}) | @as(false) Error({errors: array}) +} diff --git a/tests/analysis_tests/tests/src/TypeArgCtx.res b/tests/analysis_tests/tests/src/TypeArgCtx.res new file mode 100644 index 0000000000..fc4c0270d7 --- /dev/null +++ b/tests/analysis_tests/tests/src/TypeArgCtx.res @@ -0,0 +1,9 @@ +type someTyp = {test: bool} +let catchResult = Support.CatchResult.Ok({ + value: { + test: true, + }, +}) + +// switch catchResult { | Ok({value: }) => () +// ^com diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index 51cf7966ac..b87cd58ad2 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -2096,6 +2096,16 @@ Path T "modulePath": "Type", "filePath": "src/Completion.res" } + }, { + "label": "TypeArgCtx", + "kind": 9, + "tags": [], + "detail": "module TypeArgCtx", + "documentation": null, + "data": { + "modulePath": "TypeArgCtx", + "filePath": "src/Completion.res" + } }, { "label": "TypeAtPosCompletion", "kind": 9, diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt index 8e745b7073..5cbc61be30 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt @@ -79,6 +79,16 @@ Path CompletionSupport.TestComponent.make "modulePath": "Type", "filePath": "src/CompletionJsxProps.res" } + }, { + "label": "TypeArgCtx", + "kind": 9, + "tags": [], + "detail": "module TypeArgCtx", + "documentation": null, + "data": { + "modulePath": "TypeArgCtx", + "filePath": "src/CompletionJsxProps.res" + } }, { "label": "TypeAtPosCompletion", "kind": 9, diff --git a/tests/analysis_tests/tests/src/expected/Support.res.txt b/tests/analysis_tests/tests/src/expected/Support.res.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt new file mode 100644 index 0000000000..62940941cb --- /dev/null +++ b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt @@ -0,0 +1,19 @@ +Complete src/TypeArgCtx.res 7:36 +posCursor:[7:36] posNoWhite:[7:35] Found pattern:[7:26->7:39] +Ppat_construct Ok:[7:26->7:28] +posCursor:[7:36] posNoWhite:[7:35] Found pattern:[7:29->7:38] +Completable: Cpattern Value[catchResult]->variantPayload::Ok($0), recordField(value) +Package opens Pervasives.JsxModules.place holder +ContextPath Value[catchResult] +Path catchResult +[{ + "label": "{}", + "kind": 22, + "tags": [], + "detail": "someTyp", + "documentation": {"kind": "markdown", "value": "```rescript\ntype someTyp = {test: bool}\n```"}, + "sortText": "A", + "insertText": "{$0}", + "insertTextFormat": 2 + }] + From 17c9787977dd4373552cbc97538690c21253779e Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 4 Jan 2025 23:12:32 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6a7c9e50c..a070fb050d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ # 12.0.0-alpha.7 (Unreleased) +#### :bug: Bug fix + +- Editor: Fix issue where completions would stop working in some scenarios with inline records. https://github.com/rescript-lang/rescript/pull/7227 + #### :nail_care: Polish - Add all standard CSS properties to `JsxDOMStyle`. https://github.com/rescript-lang/rescript/pull/7205 @@ -408,7 +412,7 @@ #### :rocket: New Feature -- Experimental support of tagged template literals, e.g. ```sql`select * from ${table}```. https://github.com/rescript-lang/rescript-compiler/pull/6250 +- Experimental support of tagged template literals, e.g. `` sql`select * from ${table} ``. https://github.com/rescript-lang/rescript-compiler/pull/6250 - Experimental support for generic/custom JSX transforms. https://github.com/rescript-lang/rescript-compiler/pull/6565 - `dict` is now a builtin type. https://github.com/rescript-lang/rescript-compiler/pull/6590 @@ -588,7 +592,7 @@ No changes compared to rc.9. #### :boom: Breaking Change -- Stop mangling object field names. If you had objects with field names containing "__" or leading "_", they won't be mangled in the compiled JavaScript and represented as it is without changes. https://github.com/rescript-lang/rescript-compiler/pull/6354 +- Stop mangling object field names. If you had objects with field names containing "\__" or leading "_", they won't be mangled in the compiled JavaScript and represented as it is without changes. https://github.com/rescript-lang/rescript-compiler/pull/6354 #### :bug: Bug Fix @@ -643,7 +647,7 @@ No changes compared to rc.9. #### :rocket: New Feature -- Introduced a new `%ffi` extension (*experimental* - not for production use!) that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. https://github.com/rescript-lang/rescript-compiler/pull/6251 +- Introduced a new `%ffi` extension (_experimental_ - not for production use!) that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. https://github.com/rescript-lang/rescript-compiler/pull/6251 - Extended untagged variants with function types. https://github.com/rescript-lang/rescript-compiler/pull/6279 #### :boom: Breaking Change @@ -721,14 +725,14 @@ No changes compared to rc.9. #### :bug: Bug Fix -- Fix broken formatting in uncurried mode for functions with _ placeholder args. https://github.com/rescript-lang/rescript-compiler/pull/6148 +- Fix broken formatting in uncurried mode for functions with \_ placeholder args. https://github.com/rescript-lang/rescript-compiler/pull/6148 - Fix issue where spreading record types with optional labels would not have their labels preserved as optional. https://github.com/rescript-lang/rescript-compiler/pull/6154 - Fix error location to be the type with the spreads when spreading record types with duplicate labels. https://github.com/rescript-lang/rescript-compiler/pull/6157 - Disable warning on `@inline` attibute on uncurried functions. https://github.com/rescript-lang/rescript-compiler/pull/6152 - Support doc comments on arguments of function types. https://github.com/rescript-lang/rescript-compiler/pull/6161 - Fix issue with record type coercion and unboxed. https://github.com/rescript-lang/rescript-compiler/issues/6158 - Fixed subtype checking for record types with "@as" attributes: The subtype relationship now takes into account the compatibility of "@as" attributes between corresponding fields, ensuring correctness in runtime representation. - https://github.com/rescript-lang/rescript-compiler/issues/6158 + https://github.com/rescript-lang/rescript-compiler/issues/6158 - Emit directive above header comment. https://github.com/rescript-lang/rescript-compiler/pull/6172 - Add error message to private extension. https://github.com/rescript-lang/rescript-compiler/pull/6175 @@ -757,7 +761,6 @@ No changes compared to rc.9. - Special case generation of uncurried functions with 1 argument of unit type so they don't take a parameter. https://github.com/rescript-lang/rescript-compiler/pull/6131 - # 11.0.0-alpha.1 #### :rocket: Main New Feature @@ -768,16 +771,16 @@ No changes compared to rc.9. #### :rocket: New Feature - Add support for uncurried mode: a mode where everything is considered uncurried, whether with or without the `.`. This can be turned on with `@@uncurried` locally in a file. For project-level configuration in `bsconfig.json`, there's a boolean config `"uncurried"`, which propagates to dependencies, to turn on uncurried mode. -Since there's no syntax for partial application in this new mode, introduce `@res.partial foo(x)` to express partial application. This is temporary and will later have some surface syntax. -Make uncurried functions a subtype of curried functions, and allow application for uncurried functions. -The `make` function of components is generated as an uncurried function. -Use best effort to determine the config when formatting a file. -https://github.com/rescript-lang/rescript-compiler/pull/5968 https://github.com/rescript-lang/rescript-compiler/pull/6080 https://github.com/rescript-lang/rescript-compiler/pull/6086 https://github.com/rescript-lang/rescript-compiler/pull/6087 + Since there's no syntax for partial application in this new mode, introduce `@res.partial foo(x)` to express partial application. This is temporary and will later have some surface syntax. + Make uncurried functions a subtype of curried functions, and allow application for uncurried functions. + The `make` function of components is generated as an uncurried function. + Use best effort to determine the config when formatting a file. + https://github.com/rescript-lang/rescript-compiler/pull/5968 https://github.com/rescript-lang/rescript-compiler/pull/6080 https://github.com/rescript-lang/rescript-compiler/pull/6086 https://github.com/rescript-lang/rescript-compiler/pull/6087 - Customization of runtime representation of variants. This is work in progress. E.g. some restrictions on the input. See comments of the form "TODO: put restriction on the variant definitions allowed, to make sure this never happens". https://github.com/rescript-lang/rescript-compiler/pull/6095 - Introduce untagged variants https://github.com/rescript-lang/rescript-compiler/pull/6103 - Add support for unary uncurried pipe in uncurried mode https://github.com/rescript-lang/rescript-compiler/pull/5804 - Add support for partial application of uncurried functions: with uncurried application one can provide a -subset of the arguments, and return a curried type with the remaining ones https://github.com/rescript-lang/rescript-compiler/pull/5805 + subset of the arguments, and return a curried type with the remaining ones https://github.com/rescript-lang/rescript-compiler/pull/5805 - Add support for uncurried externals https://github.com/rescript-lang/rescript-compiler/pull/5815 https://github.com/rescript-lang/rescript-compiler/pull/5819 https://github.com/rescript-lang/rescript-compiler/pull/5830 https://github.com/rescript-lang/rescript-compiler/pull/5894 - Parser/Printer: unify uncurried functions of arity 0, and of arity 1 taking unit. There's now only arity 1 in the source language. https://github.com/rescript-lang/rescript-compiler/pull/5825 - Add support for default arguments in uncurried functions https://github.com/rescript-lang/rescript-compiler/pull/5835 @@ -799,12 +802,12 @@ subset of the arguments, and return a curried type with the remaining ones https - `rescript convert ` - Remove obsolete built-in project templates and the "rescript init" functionality. This is replaced by [create-rescript-app](https://github.com/rescript-lang/create-rescript-app) which is maintained separately. - Do not attempt to build ReScript from source on npm postinstall for platforms without prebuilt binaries anymore. -- Made pinned dependencies transitive: if *a* is a pinned dependency of *b* and *b* is a pinned dependency of *c*, then *a* is implicitly a pinned dependency of *c*. This change is only breaking if your build process assumes non-transitivity. +- Made pinned dependencies transitive: if _a_ is a pinned dependency of _b_ and _b_ is a pinned dependency of _c_, then _a_ is implicitly a pinned dependency of _c_. This change is only breaking if your build process assumes non-transitivity. - Curried after uncurried is not fused anymore: `(. x) => y => 3` is not equivalent to `(. x, y) => 3` anymore. It's instead equivalent to `(. x) => { y => 3 }`. -Also, `(. int) => string => bool` is not equivalen to `(. int, string) => bool` anymore. -These are only breaking changes for unformatted code. + Also, `(. int) => string => bool` is not equivalen to `(. int, string) => bool` anymore. + These are only breaking changes for unformatted code. - Exponentiation operator `**` is now right-associative. `2. ** 3. ** 2.` now compile to `Math.pow(2, Math.pow(3, 2))` and not anymore `Math.pow(Math.pow(2, 3), 2)`. Parentheses can be used to change precedence. -- Remove unsafe ``` j`$(a)$(b)` ``` interpolation deprecated in compiler version 10 https://github.com/rescript-lang/rescript-compiler/pull/6068 +- Remove unsafe `` j`$(a)$(b)` `` interpolation deprecated in compiler version 10 https://github.com/rescript-lang/rescript-compiler/pull/6068 - Remove deprecated module `Printexc` - `@deriving(jsConverter)` not supported anymore for variant types https://github.com/rescript-lang/rescript-compiler/pull/6088 - New representation for variants, where the tag is a string instead of a number. https://github.com/rescript-lang/rescript-compiler/pull/6088 @@ -853,19 +856,21 @@ These are only breaking changes for unformatted code. # 10.1.4 #### :bug: Bug Fix + - Fix implementation of directives https://github.com/rescript-lang/rescript-compiler/pull/6052 - Fix issue if the `lib` dir is included in the sources of bsconfig.json https://github.com/rescript-lang/rescript-compiler/pull/6055 - Fix issue with string escape in pattern match https://github.com/rescript-lang/rescript-compiler/pull/6062 - Fix issue with literal comparison of string constants https://github.com/rescript-lang/rescript-compiler/pull/6065 #### :rocket: New Feature + - Add support for toplevel `await` https://github.com/rescript-lang/rescript-compiler/pull/6054 #### :nail_care: Polish - Better error message for extension point https://github.com/rescript-lang/rescript-compiler/pull/6057 - Improve format check help https://github.com/rescript-lang/rescript-compiler/pull/6056 -- Deprecate unsafe ``` j`$(a)$(b)` ``` interpolation: use string templates ``` `${a}${b}` ``` instead https://github.com/rescript-lang/rescript-compiler/pull/6067 +- Deprecate unsafe `` j`$(a)$(b)` `` interpolation: use string templates `` `${a}${b}` `` instead https://github.com/rescript-lang/rescript-compiler/pull/6067 # 10.1.3 @@ -1174,6 +1179,6 @@ These are only breaking changes for unformatted code. - Removed Reason syntax support for the playground experience. See https://github.com/rescript-lang/rescript-compiler/pull/5375 ----- +--- You can find more old changelog from [docs/changelog](docs/changelog) From bc9fe37839d8c12b5fe60276d4ed907a13490fe6 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 5 Jan 2025 08:45:51 +0100 Subject: [PATCH 3/3] Do not reformat changelog --- CHANGELOG.md | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a070fb050d..8dc29eb3f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -412,7 +412,7 @@ #### :rocket: New Feature -- Experimental support of tagged template literals, e.g. `` sql`select * from ${table} ``. https://github.com/rescript-lang/rescript-compiler/pull/6250 +- Experimental support of tagged template literals, e.g. ```sql`select * from ${table}```. https://github.com/rescript-lang/rescript-compiler/pull/6250 - Experimental support for generic/custom JSX transforms. https://github.com/rescript-lang/rescript-compiler/pull/6565 - `dict` is now a builtin type. https://github.com/rescript-lang/rescript-compiler/pull/6590 @@ -592,7 +592,7 @@ No changes compared to rc.9. #### :boom: Breaking Change -- Stop mangling object field names. If you had objects with field names containing "\__" or leading "_", they won't be mangled in the compiled JavaScript and represented as it is without changes. https://github.com/rescript-lang/rescript-compiler/pull/6354 +- Stop mangling object field names. If you had objects with field names containing "__" or leading "_", they won't be mangled in the compiled JavaScript and represented as it is without changes. https://github.com/rescript-lang/rescript-compiler/pull/6354 #### :bug: Bug Fix @@ -647,7 +647,7 @@ No changes compared to rc.9. #### :rocket: New Feature -- Introduced a new `%ffi` extension (_experimental_ - not for production use!) that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. https://github.com/rescript-lang/rescript-compiler/pull/6251 +- Introduced a new `%ffi` extension (*experimental* - not for production use!) that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. https://github.com/rescript-lang/rescript-compiler/pull/6251 - Extended untagged variants with function types. https://github.com/rescript-lang/rescript-compiler/pull/6279 #### :boom: Breaking Change @@ -725,14 +725,14 @@ No changes compared to rc.9. #### :bug: Bug Fix -- Fix broken formatting in uncurried mode for functions with \_ placeholder args. https://github.com/rescript-lang/rescript-compiler/pull/6148 +- Fix broken formatting in uncurried mode for functions with _ placeholder args. https://github.com/rescript-lang/rescript-compiler/pull/6148 - Fix issue where spreading record types with optional labels would not have their labels preserved as optional. https://github.com/rescript-lang/rescript-compiler/pull/6154 - Fix error location to be the type with the spreads when spreading record types with duplicate labels. https://github.com/rescript-lang/rescript-compiler/pull/6157 - Disable warning on `@inline` attibute on uncurried functions. https://github.com/rescript-lang/rescript-compiler/pull/6152 - Support doc comments on arguments of function types. https://github.com/rescript-lang/rescript-compiler/pull/6161 - Fix issue with record type coercion and unboxed. https://github.com/rescript-lang/rescript-compiler/issues/6158 - Fixed subtype checking for record types with "@as" attributes: The subtype relationship now takes into account the compatibility of "@as" attributes between corresponding fields, ensuring correctness in runtime representation. - https://github.com/rescript-lang/rescript-compiler/issues/6158 + https://github.com/rescript-lang/rescript-compiler/issues/6158 - Emit directive above header comment. https://github.com/rescript-lang/rescript-compiler/pull/6172 - Add error message to private extension. https://github.com/rescript-lang/rescript-compiler/pull/6175 @@ -761,6 +761,7 @@ No changes compared to rc.9. - Special case generation of uncurried functions with 1 argument of unit type so they don't take a parameter. https://github.com/rescript-lang/rescript-compiler/pull/6131 + # 11.0.0-alpha.1 #### :rocket: Main New Feature @@ -771,16 +772,16 @@ No changes compared to rc.9. #### :rocket: New Feature - Add support for uncurried mode: a mode where everything is considered uncurried, whether with or without the `.`. This can be turned on with `@@uncurried` locally in a file. For project-level configuration in `bsconfig.json`, there's a boolean config `"uncurried"`, which propagates to dependencies, to turn on uncurried mode. - Since there's no syntax for partial application in this new mode, introduce `@res.partial foo(x)` to express partial application. This is temporary and will later have some surface syntax. - Make uncurried functions a subtype of curried functions, and allow application for uncurried functions. - The `make` function of components is generated as an uncurried function. - Use best effort to determine the config when formatting a file. - https://github.com/rescript-lang/rescript-compiler/pull/5968 https://github.com/rescript-lang/rescript-compiler/pull/6080 https://github.com/rescript-lang/rescript-compiler/pull/6086 https://github.com/rescript-lang/rescript-compiler/pull/6087 +Since there's no syntax for partial application in this new mode, introduce `@res.partial foo(x)` to express partial application. This is temporary and will later have some surface syntax. +Make uncurried functions a subtype of curried functions, and allow application for uncurried functions. +The `make` function of components is generated as an uncurried function. +Use best effort to determine the config when formatting a file. +https://github.com/rescript-lang/rescript-compiler/pull/5968 https://github.com/rescript-lang/rescript-compiler/pull/6080 https://github.com/rescript-lang/rescript-compiler/pull/6086 https://github.com/rescript-lang/rescript-compiler/pull/6087 - Customization of runtime representation of variants. This is work in progress. E.g. some restrictions on the input. See comments of the form "TODO: put restriction on the variant definitions allowed, to make sure this never happens". https://github.com/rescript-lang/rescript-compiler/pull/6095 - Introduce untagged variants https://github.com/rescript-lang/rescript-compiler/pull/6103 - Add support for unary uncurried pipe in uncurried mode https://github.com/rescript-lang/rescript-compiler/pull/5804 - Add support for partial application of uncurried functions: with uncurried application one can provide a - subset of the arguments, and return a curried type with the remaining ones https://github.com/rescript-lang/rescript-compiler/pull/5805 +subset of the arguments, and return a curried type with the remaining ones https://github.com/rescript-lang/rescript-compiler/pull/5805 - Add support for uncurried externals https://github.com/rescript-lang/rescript-compiler/pull/5815 https://github.com/rescript-lang/rescript-compiler/pull/5819 https://github.com/rescript-lang/rescript-compiler/pull/5830 https://github.com/rescript-lang/rescript-compiler/pull/5894 - Parser/Printer: unify uncurried functions of arity 0, and of arity 1 taking unit. There's now only arity 1 in the source language. https://github.com/rescript-lang/rescript-compiler/pull/5825 - Add support for default arguments in uncurried functions https://github.com/rescript-lang/rescript-compiler/pull/5835 @@ -802,12 +803,12 @@ No changes compared to rc.9. - `rescript convert ` - Remove obsolete built-in project templates and the "rescript init" functionality. This is replaced by [create-rescript-app](https://github.com/rescript-lang/create-rescript-app) which is maintained separately. - Do not attempt to build ReScript from source on npm postinstall for platforms without prebuilt binaries anymore. -- Made pinned dependencies transitive: if _a_ is a pinned dependency of _b_ and _b_ is a pinned dependency of _c_, then _a_ is implicitly a pinned dependency of _c_. This change is only breaking if your build process assumes non-transitivity. +- Made pinned dependencies transitive: if *a* is a pinned dependency of *b* and *b* is a pinned dependency of *c*, then *a* is implicitly a pinned dependency of *c*. This change is only breaking if your build process assumes non-transitivity. - Curried after uncurried is not fused anymore: `(. x) => y => 3` is not equivalent to `(. x, y) => 3` anymore. It's instead equivalent to `(. x) => { y => 3 }`. - Also, `(. int) => string => bool` is not equivalen to `(. int, string) => bool` anymore. - These are only breaking changes for unformatted code. +Also, `(. int) => string => bool` is not equivalen to `(. int, string) => bool` anymore. +These are only breaking changes for unformatted code. - Exponentiation operator `**` is now right-associative. `2. ** 3. ** 2.` now compile to `Math.pow(2, Math.pow(3, 2))` and not anymore `Math.pow(Math.pow(2, 3), 2)`. Parentheses can be used to change precedence. -- Remove unsafe `` j`$(a)$(b)` `` interpolation deprecated in compiler version 10 https://github.com/rescript-lang/rescript-compiler/pull/6068 +- Remove unsafe ``` j`$(a)$(b)` ``` interpolation deprecated in compiler version 10 https://github.com/rescript-lang/rescript-compiler/pull/6068 - Remove deprecated module `Printexc` - `@deriving(jsConverter)` not supported anymore for variant types https://github.com/rescript-lang/rescript-compiler/pull/6088 - New representation for variants, where the tag is a string instead of a number. https://github.com/rescript-lang/rescript-compiler/pull/6088 @@ -856,21 +857,19 @@ No changes compared to rc.9. # 10.1.4 #### :bug: Bug Fix - - Fix implementation of directives https://github.com/rescript-lang/rescript-compiler/pull/6052 - Fix issue if the `lib` dir is included in the sources of bsconfig.json https://github.com/rescript-lang/rescript-compiler/pull/6055 - Fix issue with string escape in pattern match https://github.com/rescript-lang/rescript-compiler/pull/6062 - Fix issue with literal comparison of string constants https://github.com/rescript-lang/rescript-compiler/pull/6065 #### :rocket: New Feature - - Add support for toplevel `await` https://github.com/rescript-lang/rescript-compiler/pull/6054 #### :nail_care: Polish - Better error message for extension point https://github.com/rescript-lang/rescript-compiler/pull/6057 - Improve format check help https://github.com/rescript-lang/rescript-compiler/pull/6056 -- Deprecate unsafe `` j`$(a)$(b)` `` interpolation: use string templates `` `${a}${b}` `` instead https://github.com/rescript-lang/rescript-compiler/pull/6067 +- Deprecate unsafe ``` j`$(a)$(b)` ``` interpolation: use string templates ``` `${a}${b}` ``` instead https://github.com/rescript-lang/rescript-compiler/pull/6067 # 10.1.3 @@ -1179,6 +1178,6 @@ No changes compared to rc.9. - Removed Reason syntax support for the playground experience. See https://github.com/rescript-lang/rescript-compiler/pull/5375 ---- +---- You can find more old changelog from [docs/changelog](docs/changelog)