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

Boogie crash: Error: invalid argument types (Box and DatatypeType) to binary operator == #4983

Closed
selig opened this issue Jan 12, 2024 · 0 comments · Fixed by #5058
Closed
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking part: verifier Translation from Dafny to Boogie (translator)

Comments

@selig
Copy link

selig commented Jan 12, 2024

Dafny version

4.4.0

Code to produce this issue

trait Foo {}
datatype Bar extends Foo = Bar

function getFoo() : Foo { Bar }

Command to run and resulting output

dafny verify --type-system-refresh --general-traits:datatype

tmpg7YYPr.tmp.dfy(4,9): Error: invalid argument types (Box and DatatypeType) to binary operator ==
tmpg7YYPr.tmp.dfy(4,9): Error: invalid argument types (Box and DatatypeType) to binary operator ==
2 type checking errors detected in /tmp/tmpg7YYPr.tmp__module.bpl

*** Encountered internal translation error - re-running Boogie to get better debug information

/tmp/tmpg7YYPr.tmp__module.bpl(2838,34): Error: invalid argument types (Box and DatatypeType) to binary operator ==
/tmp/tmpg7YYPr.tmp__module.bpl(2843,34): Error: invalid argument types (Box and DatatypeType) to binary operator ==
2 type checking errors detected in /tmp/tmpg7YYPr.tmp__module.bpl

What happened?

Expected it to verify; it crashed.

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

Other

@selig selig added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Jan 12, 2024
@atomb atomb added part: verifier Translation from Dafny to Boogie (translator) part: resolver Resolution and typechecking labels Jan 12, 2024
RustanLeino added a commit to RustanLeino/dafny that referenced this issue Feb 6, 2024
Fixes dafny-lang#4983
Actually, this was fixed already in dafny-lang#4997
RustanLeino added a commit that referenced this issue Feb 7, 2024
This PR fixes and closes three reported bugs related to datatypes
extending traits:

* Reference-type traits used with `import opened` were not recognized as
reference types (issue #4936).
* Implicit conversions from a datatype to a parent trait had caused
malformed Boogie (issue #4983). This was actually fixed in PR #4997, but
the present PR adds tests for it.
* Equality (and disequality) comparisons with a datatype (or codatatype)
on the _left_ and a parent trait on the _right_ had caused malformed
Boogie (issue #4994).

Fixes #4936
Closes #4983
Fixes #4994


<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
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 part: resolver Resolution and typechecking part: verifier Translation from Dafny to Boogie (translator)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants