caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* question on type checking
@ 2007-03-20 18:20 Stephen Weeks
  2007-03-21 15:51 ` [Caml-list] " Derek Dreyer
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Weeks @ 2007-03-20 18:20 UTC (permalink / raw)
  To: caml-list

Why does one of the programs below fail to type check while the other two minor
variants succeed?  I would expect all three to succeed.

----------------------------------------------------------------------
(* FAILS *)
module F (Z : sig end) = struct
  type t = A
end

module S = struct
  module Z = struct end
  module M = F (Z)
  include M
end

let f x =
  let module S = S in
  match x with
  | S.A -> ()
----------------------------------------------------------------------
(* WORKS *)
module F (Z : sig end) = struct
  type t = A
end

module S = struct
  module M = F (struct end)
  include M
end

let f x =
  let module S = S in
  match x with
  | S.A -> ()
----------------------------------------------------------------------
(* WORKS *)
module F (Z : sig end) = struct
  type t = A
end

module S = struct
  module Z = struct end
  module M = F (Z)
  include M
end

let f x =
  match x with
  | S.A -> ()
----------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-26 14:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-20 18:20 question on type checking Stephen Weeks
2007-03-21 15:51 ` [Caml-list] " Derek Dreyer
2007-03-22  1:13   ` Stephen Weeks
2007-03-22  4:32     ` Derek Dreyer
2007-03-26 14:24       ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).