summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-warnings/application.ml
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typing-warnings/application.ml')
-rw-r--r--testsuite/tests/typing-warnings/application.ml50
1 files changed, 48 insertions, 2 deletions
diff --git a/testsuite/tests/typing-warnings/application.ml b/testsuite/tests/typing-warnings/application.ml
index 04883f44e5..8ad444b079 100644
--- a/testsuite/tests/typing-warnings/application.ml
+++ b/testsuite/tests/typing-warnings/application.ml
@@ -1,6 +1,6 @@
(* TEST
- flags = " -w +A -strict-sequence "
- * expect
+ flags = " -w +A -strict-sequence ";
+ expect;
*)
(* Ignore OCAMLRUNPARAM=b to be reproducible *)
@@ -79,6 +79,52 @@ maybe some arguments are missing.
val f : t -> unit = <fun>
|}]
+let f a b = a + b;;
+match f 42 with
+| _ -> ();;
+[%%expect {|
+val f : int -> int -> int = <fun>
+Line 2, characters 6-10:
+2 | match f 42 with
+ ^^^^
+Warning 5 [ignored-partial-application]: this function application is partial,
+maybe some arguments are missing.
+
+- : unit = ()
+|}]
+
+let f a b = a + b;;
+match f 42 with
+| _ -> ()
+| exception _ -> ();;
+[%%expect {|
+val f : int -> int -> int = <fun>
+Line 2, characters 6-10:
+2 | match f 42 with
+ ^^^^
+Warning 5 [ignored-partial-application]: this function application is partial,
+maybe some arguments are missing.
+
+- : unit = ()
+|}]
+
+let f a b = a + b;;
+match f 42 with
+| x -> ignore (x 34);;
+[%%expect {|
+val f : int -> int -> int = <fun>
+- : unit = ()
+|}]
+
+
+let f a b = a + b;;
+match (f 42 : _) with
+| _ -> ();;
+[%%expect {|
+val f : int -> int -> int = <fun>
+- : unit = ()
+|}]
+
let _ = raise Exit 3;;
[%%expect {|
Line 1, characters 19-20: