carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

choice: don't require empty `()`

Open jonmeow opened this issue 3 years ago • 1 comments

https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/README.md#choice-types has example code:

choice IntResult {
  Success(value: i32),
  Failure(error: String),
  Cancelled
}

...

  case .Cancelled => {
    Terminate();
  }

Right now, it would be Cancelled() with parentheses: https://carbon.compiler-explorer.com/z/3dnK4xP38

Probably the right choice here is to not require parentheses in the explorer, although that'll probably require some extra handling of choices so that the parentheses are only conditionally required.

jonmeow avatar Aug 24 '22 20:08 jonmeow

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time. This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar Nov 23 '22 02:11 github-actions[bot]

Closing explorer-specific issues as not-planned for now due to our decision to prioritize working on the toolchain over other implementation work in the near term: https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md

chandlerc avatar Jan 20 '24 00:01 chandlerc