Version française
Home     About     Download     Resources     Contact us    
Browse thread
possible infinite loop in compiler
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Craig Falls <cfalls@g...>
Subject: possible infinite loop in compiler
The following code blows the stack in ocamlc and ocamlopt 3.09.3:

module Foo : sig
   type 'a t = private 'a constraint 'a = [< `foo ]
 end = struct
   type 'a t = 'a constraint 'a = [< `foo ]
 end

Other row types such as [> `foo ] also cause the error.  The following
version returns a confusing (to me) error message:

module Foo : sig
   type 'a t = private 'a constraint 'a = [< `foo ]
 end = struct
   type 'a t = private 'a constraint 'a = [< `foo ]
 end

Signature mismatch:
 Modules do not match:
   sig type 'a t = private 'a constraint 'a = [< `foo ] end
 is not included in
   sig type 'a t = private 'a constraint 'a = [< `foo ] end
 Type declarations do not match:
   type 'a t = private 'a constraint 'a = [< `foo ]
 is not included in
   type 'a t constraint 'a = [< `foo ]