From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 3F678BC69 for ; Tue, 20 Mar 2007 19:20:41 +0100 (CET) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2KIKdWu012531 for ; Tue, 20 Mar 2007 19:20:40 +0100 Received: by an-out-0708.google.com with SMTP id c24so1707192ana for ; Tue, 20 Mar 2007 11:20:38 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=YYxkcvgqcKevdfx9Wtt8LSkoGdqbNbLWExg1aD9HqDzNtFki9WqcKIRfMsByXJVr5RoZKHC+Q6yY0osaTft8KtuFY5RXhpe+W4z8DTqOvA8UcZE9iMiwItXHeuQCDR9QTVxyiL9qP95V0yzZY/VYpaPzdo9yCMh4B68f5euhHYM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=oZ6MkQn0dBgXoV1FQtaUgmk6eCCDOvAg3CSFezE9Z2IoKqTgLb5nfxW52+xLSxOk3WXqmvPu2PJ8cOEq8glEC1fzOu//NUdaeXKTMuF7DEWrh0vrGzZ0RPC1uKM9R16Ej2FKr9ulX+U0wZ+5I0huREox/BdK5bL5YHsnrnbQ3LQ= Received: by 10.100.33.14 with SMTP id g14mr5399750ang.1174414838324; Tue, 20 Mar 2007 11:20:38 -0700 (PDT) Received: by 10.100.133.18 with HTTP; Tue, 20 Mar 2007 11:20:38 -0700 (PDT) Message-ID: <604682010703201120j54305a8dmf7174f434cedfa96@mail.gmail.com> Date: Tue, 20 Mar 2007 14:20:38 -0400 From: "Stephen Weeks" Sender: stephentweeks@gmail.com To: caml-list@yquem.inria.fr Subject: question on type checking MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 74c80098a1b8e246 X-Miltered: at discorde with ID 460025F7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 sig:01 struct:01 struct:01 sig:01 minor:01 match:02 match:02 checking:02 module:03 module:03 let:03 let:03 fails:05 end:12 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 -> () ----------------------------------------------------------------------