Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in O'Caml 3.00 #2453

Closed
vicuna opened this issue May 15, 2000 · 2 comments
Closed

Bug in O'Caml 3.00 #2453

vicuna opened this issue May 15, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented May 15, 2000

Original bug ID: 112
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hello, 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

@vicuna
Copy link
Author

vicuna commented May 15, 2000

Comment author: administrator

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

@vicuna
Copy link
Author

vicuna commented May 16, 2000

Comment author: administrator

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

@vicuna vicuna closed this as completed May 16, 2000
@vicuna vicuna mentioned this issue Mar 14, 2019
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant