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

Dummy location reported for type error in toplevel declaration involving private #7819

Closed
vicuna opened this issue Jul 11, 2018 · 3 comments
Closed

Comments

@vicuna
Copy link

vicuna commented Jul 11, 2018

Original bug ID: 7819
Reporter: @Armael
Status: new
Resolution: open
Priority: normal
Severity: minor
Version: 4.07.0
Category: toplevel

Bug description

The following toplevel phrase produces a type error with a dummy location:

$ TERM=dumb ocaml

# type 'a t = private < x : int; .. > as 'a;;
Characters -1--1:
  type 'a t = private < x : int; .. > as 'a;;
  
Error: Type declarations do not match:
         type 'a t = private < x : int; .. > constraint 'a = 'a t
       is not included in
         type 'a t
       Their constraints differ.
@mrmr1993
Copy link
Contributor

This appears to be fixed in trunk:

$ TERM=dumb make runtop

        OCaml version 4.11.0+dev0-2019-10-18

# type 'a t = private < x : int; .. > as 'a;;
Line 1:
Error: Type declarations do not match:
         type 'a t = private < x : int; .. > constraint 'a = 'a t
       is not included in
         type 'a t
       Their constraints differ.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Jan 20, 2021
@gasche
Copy link
Member

gasche commented Jan 20, 2021

I don't know what the issue was and whether it really was fixed. Even on 4.07, calling ocaml /tmp/foo.ml would print correct locations for this sentence. Interactive use with TERM=dumb does indeed show nonsensical locations, and later versions of the toplevel stop doing this, but I don't know if there ever was a nonsensical location parsed for the sentence (maybe the dummy-loc came from some other place) and if this location actually changed, or we just got better at not printing the location when we don't know.

In any case, indeed the user-facing issue (-1 in a location) is gone in 4.08 and later (note: 4.08 still prints the file as _none_ which is a bit confusing, but then 4.09 and later don't do this either), so I will close the issue as not-an-issue-anymore.

Thanks for the reporting work.

@gasche gasche closed this as completed Jan 20, 2021
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

3 participants