fail_choice_pattern_extra_parens.carbon 667 B

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // RUN: %{not} %{explorer-run}
  7. // RUN: %{not} %{explorer-run-trace}
  8. package ExplorerTest api;
  9. choice Ints {
  10. None,
  11. One(i32),
  12. Two(i32, i32)
  13. }
  14. fn Main() -> i32 {
  15. match (Ints.None) {
  16. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/basic_syntax/fail_choice_pattern_extra_parens.carbon:[[@LINE+1]]: alternative `choice Ints.None` does not expect an argument list
  17. case Ints.None() => { return 0; }
  18. default => { return 1; }
  19. }
  20. }