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

Confusing error message about bit-vector types #3390

Open
davidcok opened this issue Jan 22, 2023 · 1 comment
Open

Confusing error message about bit-vector types #3390

davidcok opened this issue Jan 22, 2023 · 1 comment
Assignees
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking

Comments

@davidcok
Copy link
Collaborator

Dafny version

3.10.0+dev

Code to produce this issue

const z := 1 as bv4 | 1 as bv2 << 2

Command to run and resulting output

dafny resolve test.dfy

What happened?

The error message is 'Error: second argument to | must be of a bitvector type (instead got bv2)'
Of course, bv2 is a bit-vector type, so what is wrong??? (It is not just not the right bit-vector type.

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

Mac

@davidcok davidcok added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Jan 22, 2023
@davidcok davidcok self-assigned this Apr 22, 2023
@olivier-aws olivier-aws added the part: resolver Resolution and typechecking label Jan 14, 2025
@olivier-aws
Copy link
Contributor

olivier-aws commented Jan 14, 2025

Note that the refresh resolver (#5653) fixes this issue as it provides the clearer message:

bug.dfy(1,20): Error: type of right argument to | (bv2) must agree with the result type (bv4)
  |
1 | const z := 1 as bv4 | 1 as bv2 << 2
  |

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

No branches or pull requests

2 participants