Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000112OCamlOCaml generalpublic2000-05-15 17:062000-05-16 10:41
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000112: Bug in O'Caml 3.00
DescriptionHello, Xavier!

When I try to compile by Ocaml-3.00 under RH Linux 6.2 on x86
the following program:

--------CUT-------
type data = int
type key = string
type no = int

type elt = {no: int}
module Nset = Set.Make (struct type t = elt let compare = compare end)
let remove by_no elt = Nset.remove elt by_no
--------CUT-------

compiler crashed with the following message:

Uncaught exception: Stack overflow

When I change `elt' to the any other identifier all works.
Also this sample compiled well when I remove 3 first type
declarations.

Regargs,
Anton Moscal

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000389)
administrator (administrator)
2000-05-15 17:57

> When I try to compile by Ocaml-3.00 under RH Linux 6.2 on x86
> the following program:
> compiler crashed with the following message:
> Uncaught exception: Stack overflow
> When I change `elt' to the any other identifier all works.
> Also this sample compiled well when I remove 3 first type
> declarations.

You've found a long-standing bug in the OCaml type-checker. The bug
is due to a bad handling of name clashes in type substitution.

Your example exposes this bug because you're defining a type named
"elt" as 4th definition of your module, while the result signature for
Set.Make also contains a type named "elt" as 4th definition of the
module "Set", hence the name clash.

I expect to be able to fix this bug in the next few days.

Thanks for the nicely delineated bug report.

Best regards,

- Xavier Leroy

(0000390)
administrator (administrator)
2000-05-16 10:41

Fixed on 2000-05-16 by Xavier (missing alpha-conversion in Subst.modtype and
Subst.signature).

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker