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

Type parameter Equality wrongly inferred #5844

Open
MikaelMayer opened this issue Oct 18, 2024 · 0 comments
Open

Type parameter Equality wrongly inferred #5844

MikaelMayer opened this issue Oct 18, 2024 · 0 comments
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@MikaelMayer
Copy link
Member

Dafny version

latest-nightly

Code to produce this issue

method Test<T>(ghost s: iset<T>) {
}
ghost function domain<T>(s: seq<T>): iset<T> {
  iset t: T | t in s
}
method TestWrapper<T>(s: seq<T>) {
  var d := domain(s);
  Test(d);
}

Command to run and resulting output

dafny verify

What happened?

It complains that the type parameter of TestWrapper should support equality when it's not necessary. So there are two contradicting issues here:

  1. The type parameter of domain is not inferred to require equality although it returns a ghost iset
  2. The type parameter of Test is inferred to require equality because of a ghost iset.

What type of operating system are you experiencing the problem on?

Windows

@MikaelMayer MikaelMayer added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
Development

No branches or pull requests

1 participant