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
Closed

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

vicuna opened this issue Mar 26, 2013 · 2 comments

Comments

@vicuna
Copy link

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
Copy link
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
Copy link
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
Projects
None yet
Development

No branches or pull requests

2 participants