Skip to content

Commit

Permalink
test: show the uncurried alert during migration to [@u0]
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jan 9, 2024
1 parent 5c87d53 commit 66a247a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/blackbox-tests/uncurry-0.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,26 @@ Test some error cases
^^^^^^^^^
Error: `[@u0]' cannot be used with multiple arguments
[2]
PPX shows an alert when `@u` is used with `unit`
$ cat > x.ml <<EOF
> external foo : (((unit -> unit)[@u]) -> unit) -> unit = "foo"
> let () = foo (fun f -> f () [@u])
> EOF
$ melc -ppx melppx x.ml
File "x.ml", line 1, characters 18-30:
1 | external foo : (((unit -> unit)[@u]) -> unit) -> unit = "foo"
^^^^^^^^^^^^
Alert uncurried: This uncurried function takes a single unit argument, but will be applied with `undefined' in the compiled JS.
Use `[@u0]' if it is intended to have 0-arity.
// Generated by Melange
'use strict';
foo(function (f) {
f(undefined);
});
/* Not a pure module */

0 comments on commit 66a247a

Please sign in to comment.