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

Assert failure during typing of class #5858

Closed
vicuna opened this issue Dec 18, 2012 · 3 comments
Closed

Assert failure during typing of class #5858

vicuna opened this issue Dec 18, 2012 · 3 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Dec 18, 2012

Original bug ID: 5858
Reporter: Julien Signoles
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:21:05Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 4.00.1
Fixed in version: 4.00.2+dev
Category: typing
Has duplicate: #6083

Bug description

$ less bug.mli
class type c = object end
module type S = sig class c: c end
$ ocamlc -c bug.mli
Fatal error: exception Assert_failure("typing/env.ml", 629, 54)

Renaming the class 'c' into 'd' solves this bug.

I guess this program is erroneous since the type of S.c does not refer to the class type c outside S but to S.c itself (even if I'm not sure that scoping rules of class identifiers is precisely documented).

Anyway crashing instead of reporting a nice error message is a bit extreme ;-).

@vicuna
Copy link
Author

vicuna commented Dec 18, 2012

Comment author: @garrigue

Fixed in trunk and 4.00, at revisions 13137 and 13138.

This was a bug in the detection of unused types.
Alain, you may want to have a look at it...

@vicuna
Copy link
Author

vicuna commented Jul 12, 2013

Comment author: @ivg

Not sure, if this is the same bug:

cat test.mli
class a: a -> a

ocamlc -c test.mli
Fatal error: exception Assert_failure("typing/env.ml", 629, 54)

@vicuna
Copy link
Author

vicuna commented Jul 12, 2013

Comment author: @garrigue

Looks so. At least it is already fixed in subversion:

ocamlc -c test.mli
File "test.mli", line 1, characters 15-16:
Error: The class type a is not yet completely defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants