Fix PR#6158

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14062 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jacques Garrigue 2013-09-05 08:25:30 +00:00
parent fe6ff6a033
commit 7185e693f5
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,9 @@
type 'a t = T of 'a
type 'a s = S of 'a
type (_, _) eq = Refl : ('a, 'a) eq;;
let f : (int s, int t) eq -> unit = function Refl -> ();;
module M (S : sig type 'a t = T of 'a type 'a s = T of 'a end) =
struct let f : ('a S.s, 'a S.t) eq -> unit = function Refl -> () end;;

View File

@ -0,0 +1,19 @@
# type 'a t = T of 'a
type 'a s = S of 'a
type (_, _) eq = Refl : ('a, 'a) eq
# Characters 46-50:
let f : (int s, int t) eq -> unit = function Refl -> ();;
^^^^
Error: This pattern matches values of type (int s, int s) eq
but a pattern was expected which matches values of type
(int s, int t) eq
Type int s is not compatible with type int t
# Characters 120-124:
struct let f : ('a S.s, 'a S.t) eq -> unit = function Refl -> () end;;
^^^^
Error: This pattern matches values of type (ex#0 S.s, ex#1 S.t) eq
but a pattern was expected which matches values of type
(ex#0 S.s, ex#0 S.t) eq
The type constructor ex#0 would escape its scope
#

View File

@ -0,0 +1,15 @@
# type 'a t = T of 'a
type 'a s = S of 'a
type (_, _) eq = Refl : ('a, 'a) eq
# Characters 46-50:
let f : (int s, int t) eq -> unit = function Refl -> ();;
^^^^
Error: This pattern matches values of type (int s, int s) eq
but a pattern was expected which matches values of type
(int s, int t) eq
Type int s is not compatible with type int t
# module M :
functor (S : sig type 'a t = T of 'a type 'a s = T of 'a end) ->
sig val f : (a#0 S.s, a#0 S.t) eq -> unit end
#