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

--warn-missing-constructor-parentheses doesn't warn when missing constructor arguments #5409

Open
robin-aws opened this issue May 6, 2024 · 0 comments
Assignees
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking priority: next Will consider working on this after in progress work is done

Comments

@robin-aws
Copy link
Member

Dafny version

4.6.0 (but pretty sure it's always been like this)

Code to produce this issue

datatype Foo = Bar(a: int) | Baz | Quaz

predicate Dorp(f: Foo) {
  match f {
    case Baz() => false
    case Bar => true
  }
}

Command to run and resulting output

% dafny resolve Scratch.dfy --warn-missing-constructor-parentheses

Dafny program verifier did not attempt verification

What happened?

--warn-missing-constructor-parentheses is intended to warn against typos when trying to reference a data constructor in a match case, which results in binding the value to a new symbol instead. The code above is an instance of this mistake, where there is no warning that Bar is actually a new symbol instead of a reference to Bar, and also no verifier warning that Quaz is not handled. If Bar(a: int) is changed to just Bar the warning does occur.

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

Mac

@robin-aws robin-aws added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking priority: next Will consider working on this after in progress work is done labels May 6, 2024
@alex-chew alex-chew self-assigned this May 14, 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 part: resolver Resolution and typechecking priority: next Will consider working on this after in progress work is done
Projects
None yet
Development

No branches or pull requests

2 participants