fail_choice_pattern_no_parens.carbon 730 B

12345678910111213141516171819202122232425
  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. case Ints.None => { return 0; }
  17. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/basic_syntax/fail_choice_pattern_no_parens.carbon:[[@LINE+3]]: type error in `match` pattern type
  18. // CHECK:STDERR: expected: fn () -> choice Ints
  19. // CHECK:STDERR: actual: choice Ints
  20. default => { return 1; }
  21. }
  22. }