Browse thread
question on type checking
- Stephen Weeks
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2007-03-20 (18:20) |
From: | Stephen Weeks <sweeks@s...> |
Subject: | question on type checking |
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 -> () ----------------------------------------------------------------------