diff options
author | Nicolás Ojeda Bär <n.oje.bar@gmail.com> | 2018-08-10 14:17:47 +0200 |
---|---|---|
committer | Nicolás Ojeda Bär <n.oje.bar@gmail.com> | 2018-08-16 13:10:27 +0530 |
commit | 68ee35df6b980ca243df66bb3c09cb169ba57938 (patch) | |
tree | a676dec21417a7b193c855d019e6721a505f8a0f | |
parent | 6778e16e37819eeff7be066bec14288d9afac5c6 (diff) | |
download | ocaml-68ee35df6b980ca243df66bb3c09cb169ba57938.tar.gz |
Port typing-warnings/pr7085 to expect
-rw-r--r-- | testsuite/tests/typing-warnings/pr7085.compilers.reference | 19 | ||||
-rw-r--r-- | testsuite/tests/typing-warnings/pr7085.ml | 24 |
2 files changed, 23 insertions, 20 deletions
diff --git a/testsuite/tests/typing-warnings/pr7085.compilers.reference b/testsuite/tests/typing-warnings/pr7085.compilers.reference deleted file mode 100644 index 6ed53d5208..0000000000 --- a/testsuite/tests/typing-warnings/pr7085.compilers.reference +++ /dev/null @@ -1,19 +0,0 @@ -Line 22, characters 5-35: - match M.is_t () with None -> 0 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Warning 8: this pattern-matching is not exhaustive. -Here is an example of a case that is not matched: -Some (Is Eq) -module TypEq : sig type (_, _) t = Eq : ('a, 'a) t end -module type T = - sig - type _ is_t = Is : ('a, 'b) TypEq.t -> 'a is_t - val is_t : unit -> unit is_t option - end -module Make : functor (M : T) -> sig val f : unit -> int end -Line 4, characters 30-31: - let g : t -> int = function _ -> . - ^ -Error: This match case could not be refuted. - Here is an example of a value that would reach it: T (Is Eq) - diff --git a/testsuite/tests/typing-warnings/pr7085.ml b/testsuite/tests/typing-warnings/pr7085.ml index b2185c9246..9089c8ca1c 100644 --- a/testsuite/tests/typing-warnings/pr7085.ml +++ b/testsuite/tests/typing-warnings/pr7085.ml @@ -1,6 +1,6 @@ (* TEST flags = " -w A -strict-sequence " - * toplevel + * expect *) module TypEq = struct @@ -21,8 +21,30 @@ module Make (M : T) = let f () = match M.is_t () with None -> 0 end;; +[%%expect {| +module TypEq : sig type (_, _) t = Eq : ('a, 'a) t end +module type T = + sig + type _ is_t = Is : ('a, 'b) TypEq.t -> 'a is_t + val is_t : unit -> unit is_t option + end +Line 17, characters 5-35: + match M.is_t () with None -> 0 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Warning 8: this pattern-matching is not exhaustive. +Here is an example of a case that is not matched: +Some (Is Eq) +module Make : functor (M : T) -> sig val f : unit -> int end +|}] module Make2 (M : T) = struct type t = T of unit M.is_t let g : t -> int = function _ -> . end;; +[%%expect {| +Line 3, characters 30-31: + let g : t -> int = function _ -> . + ^ +Error: This match case could not be refuted. + Here is an example of a value that would reach it: T (Is Eq) +|}] |