diff options
-rw-r--r-- | testsuite/tests/typing-warnings/pr5892.ml | 3 | ||||
-rw-r--r-- | testsuite/tests/typing-warnings/pr5892.ml.reference | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typing-warnings/pr5892.ml b/testsuite/tests/typing-warnings/pr5892.ml new file mode 100644 index 000000000..bbc73b55d --- /dev/null +++ b/testsuite/tests/typing-warnings/pr5892.ml @@ -0,0 +1,3 @@ +open CamlinternalOO;; +type _ choice = Left : label choice | Right : tag choice;; +let f : label choice -> bool = function Left -> true;; (* warn *) diff --git a/testsuite/tests/typing-warnings/pr5892.ml.reference b/testsuite/tests/typing-warnings/pr5892.ml.reference new file mode 100644 index 000000000..1321634af --- /dev/null +++ b/testsuite/tests/typing-warnings/pr5892.ml.reference @@ -0,0 +1,12 @@ + +# # type _ choice = + Left : CamlinternalOO.label choice + | Right : CamlinternalOO.tag choice +# Characters 31-52: + let f : label choice -> bool = function Left -> true;; (* warn *) + ^^^^^^^^^^^^^^^^^^^^^ +Warning 8: this pattern-matching is not exhaustive. +Here is an example of a value that is not matched: +Right +val f : CamlinternalOO.label choice -> bool = <fun> +# |