caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* possible infinite loop in compiler
@ 2007-04-25 13:24 Craig Falls
  2007-04-25 23:49 ` [Caml-list] " Jon Harrop
  0 siblings, 1 reply; 3+ messages in thread
From: Craig Falls @ 2007-04-25 13:24 UTC (permalink / raw)
  To: caml-list

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 ]


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

* Re: [Caml-list] possible infinite loop in compiler
  2007-04-25 13:24 possible infinite loop in compiler Craig Falls
@ 2007-04-25 23:49 ` Jon Harrop
  2007-04-26  0:16   ` Jacques Garrigue
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Harrop @ 2007-04-25 23:49 UTC (permalink / raw)
  To: caml-list

On Wednesday 25 April 2007 14:24, Craig Falls wrote:
> 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

This appears to have been fixed in 3.10.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e


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

* Re: [Caml-list] possible infinite loop in compiler
  2007-04-25 23:49 ` [Caml-list] " Jon Harrop
@ 2007-04-26  0:16   ` Jacques Garrigue
  0 siblings, 0 replies; 3+ messages in thread
From: Jacques Garrigue @ 2007-04-26  0:16 UTC (permalink / raw)
  To: jon; +Cc: caml-list

From: Jon Harrop <jon@ffconsultancy.com>
> On Wednesday 25 April 2007 14:24, Craig Falls wrote:
> > 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
> 
> This appears to have been fixed in 3.10.

Thanks for checking.

By the way, I wonder what is the intent of the above definition.
In a private definition, the row variable is not free, so using a
constraint does not help in any way. Writing
  type t = private [< `Foo]
would be just as expressive.

Jacques Garrigue


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

end of thread, other threads:[~2007-04-26  0:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-25 13:24 possible infinite loop in compiler Craig Falls
2007-04-25 23:49 ` [Caml-list] " Jon Harrop
2007-04-26  0:16   ` Jacques Garrigue

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).