From bf46a1379d9a73e04ce98bc2ab80b4ef27f4afc7 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sat, 12 Aug 2023 15:29:06 -0700 Subject: [PATCH] Fix: uncurried application error messages (#689) --- flake.lock | 20 ++++++++++---------- test/blackbox-tests/uncurry-errors.t | 28 ++++++++++++++++++++++++++++ vendor/melange-compiler-libs | 2 +- 3 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 test/blackbox-tests/uncurry-errors.t diff --git a/flake.lock b/flake.lock index 76ecdf8c9b..1287ed37ae 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1691724809, - "narHash": "sha256-GPAOQ3pMbj9MHbYhfT6+CCG2FZaIEqmSi15V3sL0jI4=", + "lastModified": 1691878293, + "narHash": "sha256-XRYjFRwjDFYFhUzo4zjHiaMyXk3+wTvUAmJoE84HBT0=", "owner": "melange-re", "repo": "melange-compiler-libs", - "rev": "2a6e9ad6c8b08186d8b5957a5e598068f0768293", + "rev": "55d2714f4187c4b2a0a50c8574aaf26d392b3a0e", "type": "github" }, "original": { @@ -64,11 +64,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1691711944, - "narHash": "sha256-suUFgSgCFwXM3Tas388idLso86pbxYDuT2KMTkrS+tw=", + "lastModified": 1691866796, + "narHash": "sha256-qm+KI/Jm3VBGOzUrnzPbOeEIy5ZhfcthGtU/5+XNLPQ=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "cec68d222180dadb76b1a59fc36b7f302d1faf8e", + "rev": "ee442c23a912f8ef61478430d47039bda976d485", "type": "github" }, "original": { @@ -79,17 +79,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1691674669, - "narHash": "sha256-rFIqVzd7I7Do61lnUckmjvR7YxQoHhURtIbRoG5eVaQ=", + "lastModified": 1691732255, + "narHash": "sha256-r0Y7ZRst4XC25gMWSnAWd31LJ+etZOePgQlA8n9TU2g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0509cfa05fc884466c99cb0401bef04184b0d68", + "rev": "32c89128899f61681ed6a59ba7954eda3e70e95b", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0509cfa05fc884466c99cb0401bef04184b0d68", + "rev": "32c89128899f61681ed6a59ba7954eda3e70e95b", "type": "github" } }, diff --git a/test/blackbox-tests/uncurry-errors.t b/test/blackbox-tests/uncurry-errors.t new file mode 100644 index 0000000000..d35e0a7205 --- /dev/null +++ b/test/blackbox-tests/uncurry-errors.t @@ -0,0 +1,28 @@ + + + $ . ./setup.sh + + $ cat > x.ml < let x = fun [@u] a -> Js.log a + > let () = x 42 + > EOF + + $ melc -ppx melppx x.ml + File "x.ml", line 2, characters 9-10: + 2 | let () = x 42 + ^ + Error: This function is uncurried; it needs to be applied in uncurried style + [2] + + $ cat > x.ml < let y (a : (int -> int[@u])) = Js.log (a 42 [@u]) + > let () = y (fun x -> x + 1) + > EOF + + $ melc -ppx melppx x.ml + File "x.ml", line 2, characters 11-27: + 2 | let () = y (fun x -> x + 1) + ^^^^^^^^^^^^^^^^ + Error: This expression is expected to have an uncurried function + [2] + diff --git a/vendor/melange-compiler-libs b/vendor/melange-compiler-libs index 2a6e9ad6c8..55d2714f41 160000 --- a/vendor/melange-compiler-libs +++ b/vendor/melange-compiler-libs @@ -1 +1 @@ -Subproject commit 2a6e9ad6c8b08186d8b5957a5e598068f0768293 +Subproject commit 55d2714f4187c4b2a0a50c8574aaf26d392b3a0e