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

Unused type warnings seem to does not work with the ghost location #5961

Closed
vicuna opened this Issue Mar 26, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Mar 26, 2013

Original bug ID: 5961
Reporter: @bobzhang
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2016-12-07T10:47:15Z)
Resolution: fixed
Priority: normal
Severity: minor
Category: typing
Duplicate of: #5805
Child of: #6149

Bug description

I have came across a bug, when I generate a type declaration with the ghost location, the compiler will throw an exception during the typing stage, the problem is in this function
(typing/env.ml)
let set_type_used_callback name td callback =
let old =
try Hashtbl.find type_declarations (name, td.type_loc)
with Not_found -> assert false in (* assert false raise an exception *)
Hashtbl.replace type_declarations (name, td.type_loc) (fun () -> callback old)

If I fake an location as long as it's not ghost, it seems to work, would anyone confirm my problem?
Thanks

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 26, 2013

Comment author: @bobzhang

It seems to me that ghost location only does not work with type declarations, it works with value declarations, though

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 26, 2013

Comment author: @alainfrisch

Duplicate of #5805, already fixed in trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.