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

/warnMissingConstructorParenthesis warns in expressions but not in statements #2539

Closed
cpitclaudel opened this issue Aug 3, 2022 · 0 comments · Fixed by #2546 · May be fixed by #2544
Closed

/warnMissingConstructorParenthesis warns in expressions but not in statements #2539

cpitclaudel opened this issue Aug 3, 2022 · 0 comments · Fixed by #2546 · May be fixed by #2544
Assignees
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking

Comments

@cpitclaudel
Copy link
Member

cpitclaudel commented Aug 3, 2022

The following example code produces two warnings, not four, when compiled with /warnMissingConstructorParenthesis:

datatype T = A | B

method M(t: T) { // No warnings
  match t
    case A => print "A";
    case B => print "B";
}

method M'(t: T) { // 2 warnings
  print match t
    case A => "A"
    case B => "B";
}
bug.dfy(11,9): Warning: Constructor name 'A' should be followed by parentheses
bug.dfy(12,9): Warning: Constructor name 'B' should be followed by parentheses

Additionally, maybe the flag should be /warnMissingConstructorParentheses?

@cpitclaudel cpitclaudel added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: resolver Resolution and typechecking labels Aug 3, 2022
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

Successfully merging a pull request may close this issue.

2 participants