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

Lack of qualified type names makes error messages unclear #1309

Open
joscoh opened this issue Jul 15, 2021 · 1 comment
Open

Lack of qualified type names makes error messages unclear #1309

joscoh opened this issue Jul 15, 2021 · 1 comment
Assignees
Labels
area: error-reporting Clarity of the error reporting kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking

Comments

@joscoh
Copy link

joscoh commented Jul 15, 2021

The program

module A {
  module C {
    datatype Option<T> = None | Some(x : T)
  }
}

module B {
  module C {
    datatype Option<T> = None | Some(x : T)

  }
}

module C {
  import A
  import B

  lemma Bad(x: int)
  ensures A.C.Some(x) == B.C.Some(x)
}

results in the error message (on the ensures clause)

Error: arguments must have comparable types (got Option<int> and Option<int>).

It would be helpful to print the qualified names of the types in these cases.

@keyboardDrummer keyboardDrummer added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Jul 16, 2021
@tjhance
Copy link

tjhance commented Jul 23, 2021

To add on to this: I've noticed that even when Dafny does qualify type names in its error messages, it often uses import alias names in the qualifications, rather than using the canonical module name. I think having the canonical module names would be a lot more helpful to the user in determining the reason of the type error.

@robin-aws robin-aws added the part: resolver Resolution and typechecking label Sep 22, 2021
@atomb atomb added the area: error-reporting Clarity of the error reporting label Apr 21, 2022
@davidcok davidcok self-assigned this Apr 23, 2023
davidcok pushed a commit to davidcok/dafny that referenced this issue Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: error-reporting Clarity of the error reporting kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking
Projects
None yet
Development

No branches or pull requests

6 participants